2019-10-12 18:08:41 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :message do
|
2020-07-15 11:03:52 +00:00
|
|
|
content { 'Incoming Message' }
|
2019-10-12 18:08:41 +00:00
|
|
|
status { 'sent' }
|
|
|
|
message_type { 'incoming' }
|
2020-01-09 07:36:40 +00:00
|
|
|
content_type { 'text' }
|
|
|
|
account { create(:account) }
|
|
|
|
|
|
|
|
after(:build) do |message|
|
2020-06-27 16:04:53 +00:00
|
|
|
message.sender ||= create(:user, account: message.account)
|
2020-01-09 07:36:40 +00:00
|
|
|
message.inbox ||= create(:inbox, account: message.account)
|
2020-07-16 19:02:32 +00:00
|
|
|
message.conversation ||= create(:conversation, account: message.account, inbox: message.inbox)
|
2020-01-09 07:36:40 +00:00
|
|
|
end
|
2019-10-12 18:08:41 +00:00
|
|
|
end
|
|
|
|
end
|