Remove Booth Assignment officer totals and add final&system counts

This commit is contained in:
Bertocq
2017-09-25 17:33:17 +02:00
parent d449e8ee62
commit bf981ca828
4 changed files with 35 additions and 16 deletions

View File

@@ -97,11 +97,8 @@ feature 'Admin booths assignments' do
officer_assignment_2 = create(:poll_officer_assignment, booth_assignment: booth_assignment, date: poll.ends_at)
final_officer_assignment = create(:poll_officer_assignment, :final, booth_assignment: booth_assignment, date: poll.ends_at)
total_recount = create(:poll_total_result,
booth_assignment: booth_assignment,
officer_assignment: final_officer_assignment,
date: final_officer_assignment.date,
amount: 5678)
create(:poll_voter, poll: poll, booth_assignment: booth_assignment, created_at: poll.starts_at.to_date)
create(:poll_voter, poll: poll, booth_assignment: booth_assignment, created_at: poll.ends_at.to_date)
booth_assignment_2 = create(:poll_booth_assignment, poll: poll)
@@ -111,9 +108,20 @@ feature 'Admin booths assignments' do
within('#assigned_booths_list') { click_link booth.name }
click_link 'Recounts'
within('#totals') do
within("#total_system") { expect(page).to have_content "2" }
end
within('#recounts_list') do
within("#recounting_#{total_recount.date.strftime('%Y%m%d')}") do
expect(page).to have_content total_recount.amount
within("#recounting_#{poll.starts_at.to_date.strftime('%Y%m%d')}") do
expect(page).to have_content 1
end
within("#recounting_#{(poll.ends_at.to_date - 5.days).strftime('%Y%m%d')}") do
expect(page).to have_content '-'
end
within("#recounting_#{poll.ends_at.to_date.strftime('%Y%m%d')}") do
expect(page).to have_content 1
end
end
end