Chatwoot/spec/factories/messages.rb
Sojan Jose 4216d63311
feat: Ability to reply to specific tweets (#1117)
Ability to choose a specific tweet to reply to

Fixes #982
Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
2020-08-11 09:57:42 +05:30

17 lines
570 B
Ruby

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