Chatwoot/spec/factories/messages.rb
Sojan Jose 722f540b03 [Feature] Email collect message hooks (#331)
- Add email collect hook on creating conversation
- Merge contact if it already exist
2020-01-09 13:06:40 +05:30

17 lines
472 B
Ruby

# frozen_string_literal: true
FactoryBot.define do
factory :message do
content { 'Message' }
status { 'sent' }
message_type { 'incoming' }
content_type { 'text' }
account { create(:account) }
after(:build) do |message|
message.user ||= create(:user, account: message.account)
message.conversation ||= create(:conversation, account: message.account)
message.inbox ||= create(:inbox, account: message.account)
end
end
end