Simplify creating notifications in specs

This commit is contained in:
Javi Martín
2019-09-28 02:33:13 +02:00
parent f535d81877
commit 1973c61552
4 changed files with 21 additions and 18 deletions

View File

@@ -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