Feat: send fb message outside of standard messaging window (#4439)
This commit is contained in:
@@ -57,7 +57,6 @@ describe Webhooks::InstagramEventsJob do
|
||||
instagram_webhook.perform_now(test_params[:entry])
|
||||
|
||||
instagram_inbox.reload
|
||||
|
||||
expect(instagram_inbox.messages.count).to be 1
|
||||
expect(instagram_inbox.messages.last.content).to eq('This is a test message from facebook.')
|
||||
end
|
||||
|
||||
@@ -489,7 +489,7 @@ RSpec.describe Conversation, type: :model do
|
||||
let!(:conversation) { create(:conversation, inbox: facebook_inbox, account: facebook_channel.account) }
|
||||
|
||||
it 'returns false if there are no incoming messages' do
|
||||
expect(conversation.can_reply?).to eq false
|
||||
expect(conversation.can_reply?).to eq true
|
||||
end
|
||||
|
||||
it 'return false if last incoming message is outside of 24 hour window' do
|
||||
@@ -500,7 +500,7 @@ RSpec.describe Conversation, type: :model do
|
||||
conversation: conversation,
|
||||
created_at: Time.now - 25.hours
|
||||
)
|
||||
expect(conversation.can_reply?).to eq false
|
||||
expect(conversation.can_reply?).to eq true
|
||||
end
|
||||
|
||||
it 'return true if last incoming message is inside 24 hour window' do
|
||||
|
||||
@@ -60,7 +60,9 @@ describe Facebook::SendOnFacebookService do
|
||||
::Facebook::SendOnFacebookService.new(message: message).perform
|
||||
expect(bot).to have_received(:deliver).with({
|
||||
recipient: { id: contact_inbox.source_id },
|
||||
message: { text: message.content }
|
||||
message: { text: message.content },
|
||||
messaging_type: 'MESSAGE_TAG',
|
||||
tag: 'ACCOUNT_UPDATE'
|
||||
}, { page_id: facebook_channel.page_id })
|
||||
expect(bot).to have_received(:deliver).with({
|
||||
recipient: { id: contact_inbox.source_id },
|
||||
@@ -71,7 +73,9 @@ describe Facebook::SendOnFacebookService do
|
||||
url: attachment.file_url
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
messaging_type: 'MESSAGE_TAG',
|
||||
tag: 'ACCOUNT_UPDATE'
|
||||
}, { page_id: facebook_channel.page_id })
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user