Unify create comments specs

This commit is contained in:
taitus
2023-12-18 23:15:58 +01:00
parent d24c2859c4
commit ed5ba0592c
9 changed files with 33 additions and 126 deletions

View File

@@ -38,6 +38,10 @@ FactoryBot.define do
after(:create) { |poll| create(:image, imageable: poll) }
end
trait :with_author do
author factory: :user
end
transient { officers { [] } }
after(:create) do |poll, evaluator|
@@ -45,6 +49,8 @@ FactoryBot.define do
create(:poll_officer_assignment, poll: poll, officer: officer)
end
end
factory :poll_with_author, traits: [:with_author]
end
factory :poll_question, class: "Poll::Question" do