chore: Add resolve action in Dialogflow Integration (#3900)

This commit is contained in:
Pranav Raj S
2022-02-03 12:05:39 +05:30
committed by GitHub
parent dbb50e5923
commit 8dcb4a5ed4
2 changed files with 16 additions and 0 deletions

View File

@@ -75,6 +75,20 @@ describe Integrations::Dialogflow::ProcessorService do
end
end
context 'when dialogflow returns resolve action' do
let(:dialogflow_response) do
ActiveSupport::HashWithIndifferentAccess.new(
fulfillment_messages: [{ payload: { action: 'resolve' } }, { text: dialogflow_text_double }]
)
end
it 'resolves the conversation without moving it to an agent' do
processor.perform
expect(conversation.reload.status).to eql('resolved')
expect(conversation.messages.last.content).to eql('hello payload')
end
end
context 'when conversation is not bot' do
let(:conversation) { create(:conversation, account: account, status: :open) }