Skip to content

Commit

Permalink
More specs
Browse files Browse the repository at this point in the history
  • Loading branch information
alecslupu committed Dec 7, 2023
1 parent 54929c7 commit be7f581
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions gemfiles/decidim_0.26.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ end

group :test do
gem "rubocop-faker"
gem "axe-core-api", "~> 4.7.0"
end
10 changes: 6 additions & 4 deletions spec/proposals/system/edit_proposal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
require "spec_helper"

describe "Edit proposals", type: :system do
include_context "with a component"
include_context "with a component" do
let!(:component) { create(:extended_proposal_component, participatory_space: participatory_space) }
end
let(:manifest_name) { "proposals" }

let!(:user) { create :user, :confirmed, organization: participatory_process.organization }
let!(:another_user) { create :user, :confirmed, organization: participatory_process.organization }
let!(:proposal) { create :proposal, users: [user], component: component }
let!(:proposal) { create :extended_proposal, users: [user], component: component }
let!(:proposal_title) { translated(proposal.title) }

before do
Expand Down Expand Up @@ -77,7 +79,7 @@ def visit_proposal
let(:component) { create(:extended_proposal_component, :with_geocoding_enabled, participatory_space: participatory_process) }
let(:address) { "6 Villa des Nymphéas 75020 Paris" }
let(:new_address) { "6 rue Sorbier 75020 Paris" }
let!(:proposal) { create :proposal, address: address, users: [user], component: component }
let!(:proposal) { create :extended_proposal, address: address, users: [user], component: component }
let(:latitude) { 48.8682538 }
let(:longitude) { 2.389643 }

Expand Down Expand Up @@ -234,7 +236,7 @@ def visit_proposal
end

describe "editing my proposal outside the time limit" do
let!(:proposal) { create :proposal, users: [user], component: component, created_at: 1.hour.ago }
let!(:proposal) { create :extended_proposal, users: [user], component: component, created_at: 1.hour.ago }

before do
login_as another_user, scope: :user
Expand Down
7 changes: 5 additions & 2 deletions spec/proposals/system/proposal_show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
require "spec_helper"

describe "Show a Proposal", type: :system do
include_context "with a component"
let(:manifest_name) { "proposals" }
let(:proposal) { create :proposal, component: component }
include_context "with a component" do
let!(:component) { create(:extended_proposal_component,
participatory_space: participatory_space) }
end
let(:proposal) { create :extended_proposal, component: component }

def visit_proposal
visit resource_locator(proposal).path
Expand Down
6 changes: 3 additions & 3 deletions spec/proposals/system/proposals_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@

let!(:proposal) do
create(
:proposal,
:extended_proposal,
:accepted,
:official,
:with_answer,
Expand Down Expand Up @@ -225,7 +225,7 @@
context "when a proposal has costs" do
let!(:proposal) do
create(
:proposal,
:extended_proposal,
:accepted,
:with_answer,
component: component,
Expand Down Expand Up @@ -648,7 +648,7 @@
end

context "when paginating" do
let!(:collection) { create_list :proposal, collection_size, component: component }
let!(:collection) { create_list :extended_proposal, collection_size, component: component }
let!(:resource_selector) { ".card--proposal" }

it_behaves_like "a paginated resource"
Expand Down

0 comments on commit be7f581

Please sign in to comment.