Merge branch 'master' into polls_minor_changes

This commit is contained in:
María Checa
2017-10-03 16:22:33 +02:00
47 changed files with 559 additions and 173 deletions

View File

@@ -30,13 +30,13 @@ feature 'Admin shifts' do
expect(page).to have_content officer.name
end
scenario "Create Vote Collection Shift", :js do
scenario "Create Vote Collection Shift and Recount & Scrutiny Shift on same date", :js do
poll = create(:poll, :current)
vote_collection_dates = (poll.starts_at.to_date..poll.ends_at.to_date).to_a.map { |date| I18n.l(date, format: :long) }
booth = create(:poll_booth)
assignment = create(:poll_booth_assignment, poll: poll, booth: booth)
officer = create(:poll_officer)
vote_collection_dates = (poll.starts_at.to_date..poll.ends_at.to_date).to_a.map { |date| I18n.l(date, format: :long) }
recount_scrutiny_dates = (poll.ends_at.to_date..poll.ends_at.to_date + 1.week).to_a.map { |date| I18n.l(date, format: :long) }
visit available_admin_booths_path
@@ -61,15 +61,6 @@ feature 'Admin shifts' do
expect(page).to have_content("Collect Votes")
expect(page).to have_content(officer.name)
end
end
scenario "Create Recount & Scrutiny Shift", :js do
poll = create(:poll, :current)
recount_scrutiny_dates = (poll.ends_at.to_date..poll.ends_at.to_date + 1.week).to_a.map { |date| I18n.l(date, format: :long) }
booth = create(:poll_booth)
assignment = create(:poll_booth_assignment, poll: poll, booth: booth)
officer = create(:poll_officer)
visit available_admin_booths_path
@@ -91,7 +82,7 @@ feature 'Admin shifts' do
expect(page).to have_content "Shift added"
within("#shifts") do
expect(page).to have_css(".shift", count: 1)
expect(page).to have_css(".shift", count: 2)
expect(page).to have_content(I18n.l(poll.ends_at.to_date + 4.days, format: :long))
expect(page).to have_content("Recount & Scrutiny")
expect(page).to have_content(officer.name)