Chatwoot/spec/factories/campaigns.rb
Sojan Jose a07200bedf
chore: Campaign ID migration for existing accounts (#2189)
* chore: Campaign ID migration for existing accounts

* chore: update factory

* chore: minor fixes

* chore: fixes
2021-04-30 06:15:24 -07:00

16 lines
429 B
Ruby

# frozen_string_literal: true
FactoryBot.define do
factory :campaign do
sequence(:title) { |n| "Campaign #{n}" }
sequence(:message) { |n| "Campaign message #{n}" }
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