Simplify poll voter factory associations
This commit is contained in:
@@ -91,12 +91,11 @@ FactoryBot.define do
|
|||||||
origin "web"
|
origin "web"
|
||||||
|
|
||||||
trait :from_booth do
|
trait :from_booth do
|
||||||
association :booth_assignment, factory: :poll_booth_assignment
|
|
||||||
origin "booth"
|
origin "booth"
|
||||||
before :create do |voter|
|
association :booth_assignment, factory: :poll_booth_assignment
|
||||||
voter.officer_assignment = create(:poll_officer_assignment,
|
|
||||||
officer: voter.officer,
|
officer_assignment do
|
||||||
booth_assignment: voter.booth_assignment)
|
association :poll_officer_assignment, booth_assignment: booth_assignment, officer: officer
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user