Fix voters on booth not being created in dev seeds

There were validation errors because they didn't have officer nor booth
assignments.
This commit is contained in:
Javi Martín
2018-12-14 13:56:06 +01:00
parent e2fa2ecf0d
commit db7e8e79b7

View File

@@ -114,12 +114,16 @@ end
section "Creating Poll Voters" do
def vote_poll_on_booth(user, poll)
officer = Poll::Officer.all.sample
Poll::Voter.create!(document_type: user.document_type,
document_number: user.document_number,
user: user,
poll: poll,
origin: "booth",
officer: Poll::Officer.all.sample)
officer: officer,
officer_assignment: officer.officer_assignments.sample,
booth_assignment: poll.booth_assignments.sample)
end
def vote_poll_on_web(user, poll)