diff --git a/spec/factories/polls.rb b/spec/factories/polls.rb index c55101c31..7820532f7 100644 --- a/spec/factories/polls.rb +++ b/spec/factories/polls.rb @@ -7,11 +7,6 @@ FactoryBot.define do starts_at { 1.month.ago } ends_at { 1.month.from_now } - trait :current do - starts_at { 2.days.ago } - ends_at { 2.days.from_now } - end - trait :expired do starts_at { 1.month.ago } ends_at { 15.days.ago } diff --git a/spec/models/abilities/everyone_spec.rb b/spec/models/abilities/everyone_spec.rb index 7aaa1e1c5..903317158 100644 --- a/spec/models/abilities/everyone_spec.rb +++ b/spec/models/abilities/everyone_spec.rb @@ -33,12 +33,12 @@ describe Abilities::Everyone do it { should be_able_to(:results, create(:poll, :expired, results_enabled: true)) } it { should_not be_able_to(:results, create(:poll, :expired, results_enabled: false)) } - it { should_not be_able_to(:results, create(:poll, :current, results_enabled: true)) } + it { should_not be_able_to(:results, create(:poll, results_enabled: true)) } it { should_not be_able_to(:results, create(:poll, :for_budget, :expired, results_enabled: true)) } it { should be_able_to(:stats, create(:poll, :expired, stats_enabled: true)) } it { should_not be_able_to(:stats, create(:poll, :expired, stats_enabled: false)) } - it { should_not be_able_to(:stats, create(:poll, :current, stats_enabled: true)) } + it { should_not be_able_to(:stats, create(:poll, stats_enabled: true)) } it { should_not be_able_to(:stats, create(:poll, :for_budget, :expired, stats_enabled: true)) } it { should be_able_to(:read_results, create(:budget, :finished, results_enabled: true)) } diff --git a/spec/models/poll/booth_spec.rb b/spec/models/poll/booth_spec.rb index 765e3b719..67dd08706 100644 --- a/spec/models/poll/booth_spec.rb +++ b/spec/models/poll/booth_spec.rb @@ -45,7 +45,7 @@ describe Poll::Booth do describe ".available" do it "returns booths associated to current polls" do - booth_for_current_poll = create(:poll_booth, polls: [create(:poll, :current)]) + booth_for_current_poll = create(:poll_booth, polls: [create(:poll)]) booth_for_expired_poll = create(:poll_booth, polls: [create(:poll, :expired)]) expect(Poll::Booth.available).to eq [booth_for_current_poll] @@ -53,7 +53,7 @@ describe Poll::Booth do end it "returns polls with multiple translations only once" do - create(:poll_booth, polls: [create(:poll, :current, name: "English", name_es: "Spanish")]) + create(:poll_booth, polls: [create(:poll, name: "English", name_es: "Spanish")]) expect(Poll::Booth.available.count).to eq 1 end diff --git a/spec/models/poll/poll_spec.rb b/spec/models/poll/poll_spec.rb index 751f4a85a..7d48c502f 100644 --- a/spec/models/poll/poll_spec.rb +++ b/spec/models/poll/poll_spec.rb @@ -468,7 +468,7 @@ describe Poll do describe "#recounts_confirmed" do it "is false for current polls" do - poll = create(:poll, :current) + poll = create(:poll) expect(poll.recounts_confirmed?).to be false end diff --git a/spec/system/admin/poll/booths_spec.rb b/spec/system/admin/poll/booths_spec.rb index a930bf9f6..61b440bc0 100644 --- a/spec/system/admin/poll/booths_spec.rb +++ b/spec/system/admin/poll/booths_spec.rb @@ -32,7 +32,7 @@ describe "Admin booths", :admin do end scenario "Available" do - booth_for_current_poll = create(:poll_booth, polls: [create(:poll, :current)]) + booth_for_current_poll = create(:poll_booth, polls: [create(:poll)]) booth_for_expired_poll = create(:poll_booth, polls: [create(:poll, :expired)]) visit admin_root_path @@ -74,7 +74,7 @@ describe "Admin booths", :admin do end scenario "Edit" do - poll = create(:poll, :current) + poll = create(:poll) booth = create(:poll_booth, polls: [poll]) visit admin_booths_path @@ -99,7 +99,7 @@ describe "Admin booths", :admin do end scenario "Back link go back to available list when manage shifts" do - poll = create(:poll, :current) + poll = create(:poll) booth = create(:poll_booth, polls: [poll]) visit available_admin_booths_path diff --git a/spec/system/admin/poll/shifts_spec.rb b/spec/system/admin/poll/shifts_spec.rb index a5a475092..1b92aa606 100644 --- a/spec/system/admin/poll/shifts_spec.rb +++ b/spec/system/admin/poll/shifts_spec.rb @@ -27,7 +27,7 @@ describe "Admin shifts", :admin do scenario "Create Vote Collection Shift and Recount & Scrutiny Shift on same date" do create(:poll) - poll = create(:poll, :current) + poll = create(:poll) booth = create(:poll_booth, polls: [poll, create(:poll, :expired)]) officer = create(:poll_officer) vote_collection_dates = (Date.current..poll.ends_at.to_date).to_a.map { |date| I18n.l(date, format: :long) } @@ -89,7 +89,7 @@ describe "Admin shifts", :admin do end scenario "Vote Collection Shift and Recount & Scrutiny Shift don't include already assigned dates to officer" do - poll = create(:poll, :current) + poll = create(:poll) booth = create(:poll_booth, polls: [poll]) officer = create(:poll_officer) @@ -137,7 +137,7 @@ describe "Admin shifts", :admin do end scenario "Error on create" do - poll = create(:poll, :current) + poll = create(:poll) booth = create(:poll_booth, polls: [poll]) officer = create(:poll_officer) @@ -158,7 +158,7 @@ describe "Admin shifts", :admin do end scenario "Destroy" do - poll = create(:poll, :current) + poll = create(:poll) booth = create(:poll_booth, polls: [poll]) officer = create(:poll_officer) diff --git a/spec/system/budget_polls/voter_spec.rb b/spec/system/budget_polls/voter_spec.rb index 1662d9dbf..45377cdd3 100644 --- a/spec/system/budget_polls/voter_spec.rb +++ b/spec/system/budget_polls/voter_spec.rb @@ -3,7 +3,7 @@ require "rails_helper" describe "BudgetPolls", :with_frozen_time do let(:budget) { create(:budget, :balloting) } let(:investment) { create(:budget_investment, :selected, budget: budget) } - let(:poll) { create(:poll, :current, budget: budget) } + let(:poll) { create(:poll, budget: budget) } let(:booth) { create(:poll_booth) } let(:officer) { create(:poll_officer) } let(:admin) { create(:administrator) } diff --git a/spec/system/dashboard/polls_spec.rb b/spec/system/dashboard/polls_spec.rb index 33647a008..c8f477cd5 100644 --- a/spec/system/dashboard/polls_spec.rb +++ b/spec/system/dashboard/polls_spec.rb @@ -124,7 +124,7 @@ describe "Polls" do end scenario "Edit poll is not allowed for current polls" do - poll = create(:poll, :current, related: proposal) + poll = create(:poll, related: proposal) visit proposal_dashboard_polls_path(proposal) @@ -232,7 +232,7 @@ describe "Polls" do end scenario "View results available for current polls" do - poll = create(:poll, :current, related: proposal) + poll = create(:poll, related: proposal) visit proposal_dashboard_polls_path(proposal) diff --git a/spec/system/officing/voters_spec.rb b/spec/system/officing/voters_spec.rb index 9ab626784..62216860c 100644 --- a/spec/system/officing/voters_spec.rb +++ b/spec/system/officing/voters_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" describe "Voters" do - let(:poll) { create(:poll, :current) } + let(:poll) { create(:poll) } let(:booth) { create(:poll_booth) } let(:officer) { create(:poll_officer) } @@ -35,7 +35,7 @@ describe "Voters" do end scenario "Cannot vote" do - unvotable_poll = create(:poll, :current, geozone_restricted: true, geozones: [create(:geozone, census_code: "02")]) + unvotable_poll = create(:poll, geozone_restricted: true, geozones: [create(:geozone, census_code: "02")]) create(:poll_officer_assignment, officer: officer, poll: unvotable_poll, booth: booth) set_officing_booth(booth) @@ -49,7 +49,7 @@ describe "Voters" do end scenario "Already voted" do - poll2 = create(:poll, :current) + poll2 = create(:poll) create(:poll_officer_assignment, officer: officer, poll: poll2, booth: booth) user = create(:user, :level_two) @@ -84,7 +84,7 @@ describe "Voters" do context "Polls displayed to officers" do scenario "Display current polls assigned to a booth" do - poll = create(:poll, :current) + poll = create(:poll) create(:poll_officer_assignment, officer: officer, poll: poll, booth: booth) set_officing_booth(booth) @@ -96,7 +96,7 @@ describe "Voters" do end scenario "Display polls that the user can vote" do - votable_poll = create(:poll, :current, geozone_restricted: true, geozones: [Geozone.first]) + votable_poll = create(:poll, geozone_restricted: true, geozones: [Geozone.first]) create(:poll_officer_assignment, officer: officer, poll: votable_poll, booth: booth) set_officing_booth(booth) @@ -108,7 +108,7 @@ describe "Voters" do end scenario "Display polls that the user cannot vote" do - unvotable_poll = create(:poll, :current, geozone_restricted: true, geozones: [create(:geozone, census_code: "02")]) + unvotable_poll = create(:poll, geozone_restricted: true, geozones: [create(:geozone, census_code: "02")]) create(:poll_officer_assignment, officer: officer, poll: unvotable_poll, booth: booth) set_officing_booth(booth) @@ -132,8 +132,8 @@ describe "Voters" do end scenario "Do not display polls from other booths" do - poll1 = create(:poll, :current) - poll2 = create(:poll, :current) + poll1 = create(:poll) + poll2 = create(:poll) booth1 = create(:poll_booth) booth2 = create(:poll_booth) diff --git a/spec/system/polls/polls_spec.rb b/spec/system/polls/polls_spec.rb index b0eb0ccaa..d2631c873 100644 --- a/spec/system/polls/polls_spec.rb +++ b/spec/system/polls/polls_spec.rb @@ -543,7 +543,7 @@ describe "Polls" do end scenario "Don't show poll results and stats if is not expired" do - poll = create(:poll, :current, results_enabled: true, stats_enabled: true) + poll = create(:poll, results_enabled: true, stats_enabled: true) user = create(:user) login_as user diff --git a/spec/system/polls/voter_spec.rb b/spec/system/polls/voter_spec.rb index 3b9c6bc1d..46305ce4a 100644 --- a/spec/system/polls/voter_spec.rb +++ b/spec/system/polls/voter_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" describe "Voter" do context "Origin", :with_frozen_time do - let(:poll) { create(:poll, :current) } + let(:poll) { create(:poll) } let(:question) { create(:poll_question, poll: poll) } let(:booth) { create(:poll_booth) } let(:officer) { create(:poll_officer) }