Don't create an officer for poll voter factories
For web poll voters, it isn't necessary in order to make the record valid, and it adds an extra record to the database for each poll voter created.
This commit is contained in:
@@ -87,7 +87,6 @@ FactoryBot.define do
|
|||||||
factory :poll_voter, class: "Poll::Voter" do
|
factory :poll_voter, class: "Poll::Voter" do
|
||||||
poll
|
poll
|
||||||
association :user, :level_two
|
association :user, :level_two
|
||||||
association :officer, factory: :poll_officer
|
|
||||||
from_web
|
from_web
|
||||||
|
|
||||||
trait :from_web do
|
trait :from_web do
|
||||||
@@ -103,7 +102,9 @@ FactoryBot.define do
|
|||||||
end
|
end
|
||||||
|
|
||||||
officer_assignment do
|
officer_assignment do
|
||||||
association :poll_officer_assignment, booth_assignment: booth_assignment, officer: officer
|
association :poll_officer_assignment,
|
||||||
|
booth_assignment: booth_assignment,
|
||||||
|
officer: officer || association(:poll_officer)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user