Files
grecia/spec/factories/notifications.rb
Javi Martín d7b9ed1bc4 Use dynamic times and dates in factories (part 2)
Most factories were using dynamic times and dates since commit 0cf799a.
However:

* At the time, commits AyuntamientoMadrid/consul@71f5351 and
AyuntamientoMadrid/consul@a476a30 (which introduced static times/dates
in factories) hadn't been backported.
* The changes in commit 0cf799a overlooked the factory
`proposal_notification`.
2018-09-19 14:21:21 +02:00

25 lines
551 B
Ruby

FactoryBot.define do
factory :notification do
user
association :notifiable, factory: :proposal
trait :read do
read_at { Time.current }
end
end
factory :admin_notification do
title { |n| "Admin Notification title #{n}" }
body { |n| "Admin Notification body #{n}" }
link nil
segment_recipient UserSegments::SEGMENTS.sample
recipients_count nil
sent_at nil
trait :sent do
recipients_count 1
sent_at { Time.current }
end
end
end