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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user