Fix: Consider bot message on slack integration (#6793)

This commit is contained in:
Tejaswini Chile
2023-03-31 18:56:51 +05:30
committed by GitHub
parent bd5ff7a8bf
commit 21da03fe5b
7 changed files with 48 additions and 3 deletions

View File

@@ -29,6 +29,14 @@ RSpec.describe HookJob, type: :job do
described_class.perform_now(hook, event_name, event_data)
end
it 'calls Integrations::Slack::SendOnSlackService when its a slack hook for template message' do
event_data = { message: create(:message, account: account, message_type: :template) }
hook = create(:integrations_hook, app_id: 'slack', account: account)
allow(Integrations::Slack::SendOnSlackService).to receive(:new).and_return(process_service)
expect(Integrations::Slack::SendOnSlackService).to receive(:new)
described_class.perform_now(hook, event_name, event_data)
end
it 'calls Integrations::Dialogflow::ProcessorService when its a dialogflow intergation' do
hook = create(:integrations_hook, :dialogflow, inbox: inbox, account: account)
allow(Integrations::Dialogflow::ProcessorService).to receive(:new).and_return(process_service)