Refactor Booth and Booth Assignment creation into just one section

This commit is contained in:
Bertocq
2017-11-09 13:04:54 +01:00
parent cf76898308
commit 896f91e249

View File

@@ -581,15 +581,9 @@ section "Creating Poll Questions & Answers" do
end
end
section "Creating Poll Booths" do
20.times.each_with_index do |i|
Poll::Booth.create(name: "Booth #{i}", polls: [Poll.all.sample])
end
end
section "Creating Booth Assignments" do
Poll::Booth.all.each do |booth|
Poll::BoothAssignment.create(booth: booth, poll: Poll.all.sample)
section "Creating Poll Booths & BoothAssignments" do
20.times do |i|
Poll::Booth.create(name: "Booth #{i}", location: Faker::Address.street_address, polls: [Poll.all.sample])
end
end