Avoid creating extra poll records in tests
The line: create(:poll_voter, booth_assignment: booth_assignment_final_recounted) Creates a new poll for the poll voter. Not only it wastes time by creating new database records, but it doesn't make sense to have a poll voter for a poll which isn't the same as its booth assignment's poll.
This commit is contained in:
@@ -222,7 +222,9 @@ feature "Admin polls" do
|
||||
total_amount: 21)
|
||||
end
|
||||
|
||||
2.times { create(:poll_voter, booth_assignment: booth_assignment_final_recounted) }
|
||||
2.times do
|
||||
create(:poll_voter, poll: poll, booth_assignment: booth_assignment_final_recounted)
|
||||
end
|
||||
|
||||
create(:poll_recount,
|
||||
booth_assignment: booth_assignment_final_recounted,
|
||||
|
||||
Reference in New Issue
Block a user