Chore: Add Facebook app set up documentation (#647)

Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
This commit is contained in:
Sojan Jose
2020-03-28 11:43:02 +05:30
committed by GitHub
parent 209e0a0fb4
commit a3c2d4e5bd
23 changed files with 211 additions and 38 deletions

View File

@@ -46,6 +46,15 @@ describe Facebook::SendReplyService do
create(:message, message_type: 'outgoing', inbox: facebook_inbox, account: account, conversation: conversation)
expect(bot).to have_received(:deliver)
end
it 'if message with attachment is sent from chatwoot and is outgoing' do
create(:message, message_type: :incoming, inbox: facebook_inbox, account: account, conversation: conversation)
message = build(:message, message_type: 'outgoing', inbox: facebook_inbox, account: account, conversation: conversation)
message.attachment = Attachment.new(account_id: message.account_id, file_type: :image)
message.attachment.file.attach(io: File.open(Rails.root.join('spec/assets/avatar.png')), filename: 'avatar.png', content_type: 'image/png')
message.save!
expect(bot).to have_received(:deliver)
end
end
end
end