Use dynamic attributes in factories

Static attributes are deprecated since factory bot 4.11; we haven't
upgraded yet but now we're ready to do so:

https://thoughtbot.com/blog/deprecating-static-attributes-in-factory_bot-4-11
This commit is contained in:
Javi Martín
2019-06-18 01:49:08 +02:00
parent 444fc524f7
commit fc1a89e966
17 changed files with 309 additions and 309 deletions

View File

@@ -11,13 +11,13 @@ FactoryBot.define do
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
link { nil }
segment_recipient { UserSegments::SEGMENTS.sample }
recipients_count { nil }
sent_at { nil }
trait :sent do
recipients_count 1
recipients_count { 1 }
sent_at { Time.current }
end
end