Chatwoot/spec/factories/campaigns.rb

17 lines
429 B
Ruby
Raw Permalink Normal View History

2021-04-29 16:53:32 +00:00
# frozen_string_literal: true
FactoryBot.define do
factory :campaign do
sequence(:title) { |n| "Campaign #{n}" }
sequence(:message) { |n| "Campaign message #{n}" }
2021-04-29 16:53:32 +00:00
after(:build) do |campaign|
campaign.account ||= create(:account)
campaign.inbox ||= create(
:inbox,
account: campaign.account,
channel: create(:channel_widget, account: campaign.account)
)
end
end
end