feat: Add preview for attachment messages (#1562)
Add preview for pending messages and attachments Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
committed by
GitHub
parent
db189e3c26
commit
3d2db95417
@@ -58,7 +58,21 @@ describe Facebook::SendOnFacebookService do
|
||||
attachment.file.attach(io: File.open(Rails.root.join('spec/assets/avatar.png')), filename: 'avatar.png', content_type: 'image/png')
|
||||
message.save!
|
||||
::Facebook::SendOnFacebookService.new(message: message).perform
|
||||
expect(bot).to have_received(:deliver)
|
||||
expect(bot).to have_received(:deliver).with({
|
||||
recipient: { id: contact_inbox.source_id },
|
||||
message: { text: message.content }
|
||||
}, { access_token: facebook_channel.page_access_token })
|
||||
expect(bot).to have_received(:deliver).with({
|
||||
recipient: { id: contact_inbox.source_id },
|
||||
message: {
|
||||
attachment: {
|
||||
type: 'image',
|
||||
payload: {
|
||||
url: attachment.file_url
|
||||
}
|
||||
}
|
||||
}
|
||||
}, { access_token: facebook_channel.page_access_token })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user