Add scope on shift creation date ranges to current/recounting/incoming polls, plus cover with test

This commit is contained in:
Bertocq
2017-10-13 16:55:40 +02:00
parent 9146d68c53
commit 79c8c2f826
2 changed files with 4 additions and 3 deletions

View File

@@ -35,7 +35,8 @@ feature 'Admin shifts' do
create(:poll, :incoming)
poll = create(:poll, :current)
booth = create(:poll_booth)
assignment = create(:poll_booth_assignment, poll: poll, booth: booth)
create(:poll_booth_assignment, poll: poll, booth: booth)
create(:poll_booth_assignment, poll: create(:poll, :expired), 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) }