Simplify creating notifications in specs
This commit is contained in:
@@ -6,6 +6,18 @@ FactoryBot.define do
|
||||
trait :read do
|
||||
read_at { Time.current }
|
||||
end
|
||||
|
||||
trait :for_proposal_notification do
|
||||
association :notifiable, factory: :proposal_notification
|
||||
end
|
||||
|
||||
trait :for_comment do
|
||||
association :notifiable, factory: :comment
|
||||
end
|
||||
|
||||
trait :for_poll_question do
|
||||
association :notifiable, factory: :poll_question
|
||||
end
|
||||
end
|
||||
|
||||
factory :admin_notification do
|
||||
|
||||
Reference in New Issue
Block a user