Remove incoming polls filter

This commit is contained in:
decabeza
2019-02-06 14:10:12 +01:00
parent d76b618b87
commit bc1679550b
20 changed files with 21 additions and 155 deletions

View File

@@ -38,27 +38,23 @@ feature 'Admin booths' do
scenario "Available" do
booth_for_current_poll = create(:poll_booth)
booth_for_incoming_poll = create(:poll_booth)
booth_for_expired_poll = create(:poll_booth)
current_poll = create(:poll, :current)
incoming_poll = create(:poll, :incoming)
expired_poll = create(:poll, :expired)
create(:poll_booth_assignment, poll: current_poll, booth: booth_for_current_poll)
create(:poll_booth_assignment, poll: incoming_poll, booth: booth_for_incoming_poll)
create(:poll_booth_assignment, poll: expired_poll, booth: booth_for_expired_poll)
visit admin_root_path
within('#side_menu') do
within("#side_menu") do
click_link "Manage shifts"
end
expect(page).to have_css(".booth", count: 2)
expect(page).to have_css(".booth", count: 1)
expect(page).to have_content booth_for_current_poll.name
expect(page).to have_content booth_for_incoming_poll.name
expect(page).not_to have_content booth_for_expired_poll.name
expect(page).not_to have_link "Edit booth"
end

View File

@@ -32,7 +32,6 @@ feature 'Admin shifts' do
scenario "Create Vote Collection Shift and Recount & Scrutiny Shift on same date", :js do
create(:poll)
create(:poll, :incoming)
poll = create(:poll, :current)
booth = create(:poll_booth)
create(:poll_booth_assignment, poll: poll, booth: booth)

View File

@@ -75,9 +75,6 @@ feature 'Voters' do
poll_expired = create(:poll, :expired)
create(:poll_officer_assignment, officer: officer, booth_assignment: create(:poll_booth_assignment, poll: poll_expired, booth: booth))
poll_incoming = create(:poll, :incoming)
create(:poll_officer_assignment, officer: officer, booth_assignment: create(:poll_booth_assignment, poll: poll_incoming, booth: booth))
poll_geozone_restricted_in = create(:poll, :current, geozone_restricted: true, geozones: [Geozone.first])
booth_assignment = create(:poll_booth_assignment, poll: poll_geozone_restricted_in, booth: booth)
create(:poll_officer_assignment, officer: officer, booth_assignment: booth_assignment)
@@ -93,7 +90,6 @@ feature 'Voters' do
expect(page).to have_content poll.name
expect(page).not_to have_content poll_current.name
expect(page).not_to have_content poll_expired.name
expect(page).not_to have_content poll_incoming.name
expect(page).to have_content poll_geozone_restricted_in.name
expect(page).not_to have_content poll_geozone_restricted_out.name
end

View File

@@ -28,24 +28,15 @@ feature 'Polls' do
scenario 'Filtering polls' do
create(:poll, name: "Current poll")
create(:poll, :incoming, name: "Incoming poll")
create(:poll, :expired, name: "Expired poll")
visit polls_path
expect(page).to have_content('Current poll')
expect(page).to have_link('Participate in this poll')
expect(page).not_to have_content('Incoming poll')
expect(page).not_to have_content('Expired poll')
visit polls_path(filter: 'incoming')
expect(page).not_to have_content('Current poll')
expect(page).to have_content('Incoming poll')
expect(page).to have_link('More information')
expect(page).not_to have_content('Expired poll')
visit polls_path(filter: 'expired')
expect(page).not_to have_content('Current poll')
expect(page).not_to have_content('Incoming poll')
expect(page).to have_content('Expired poll')
expect(page).to have_link('Poll ended')
end
@@ -53,17 +44,10 @@ feature 'Polls' do
scenario "Current filter is properly highlighted" do
visit polls_path
expect(page).not_to have_link('Open')
expect(page).to have_link('Incoming')
expect(page).to have_link('Expired')
visit polls_path(filter: 'incoming')
expect(page).to have_link('Open')
expect(page).not_to have_link('Incoming')
expect(page).to have_link('Expired')
visit polls_path(filter: 'expired')
expect(page).to have_link('Open')
expect(page).to have_link('Incoming')
expect(page).not_to have_link('Expired')
end
@@ -204,26 +188,6 @@ feature 'Polls' do
expect(page).to have_link('Chewbacca', href: verification_path)
end
scenario 'Level 2 users in an incoming poll' do
incoming_poll = create(:poll, :incoming, geozone_restricted: true)
incoming_poll.geozones << geozone
question = create(:poll_question, poll: incoming_poll)
answer1 = create(:poll_question_answer, question: question, title: 'Rey')
answer2 = create(:poll_question_answer, question: question, title: 'Finn')
login_as(create(:user, :level_two, geozone: geozone))
visit poll_path(incoming_poll)
expect(page).to have_content('Rey')
expect(page).to have_content('Finn')
expect(page).not_to have_link('Rey')
expect(page).not_to have_link('Finn')
expect(page).to have_content('This poll has not yet started')
end
scenario 'Level 2 users in an expired poll' do
expired_poll = create(:poll, :expired, geozone_restricted: true)
expired_poll.geozones << geozone