feat: Add webhook event support for macros (#11235)
Fixes https://github.com/chatwoot/chatwoot/issues/5968 We will not support custom payload in V1.
This commit is contained in:
@@ -18,7 +18,8 @@ RSpec.describe Macros::ExecutionService, type: :service do
|
||||
{ action_name: 'assign_agent', action_params: ['self'] },
|
||||
{ action_name: 'add_private_note', action_params: ['Test note'] },
|
||||
{ action_name: 'send_message', action_params: ['Test message'] },
|
||||
{ action_name: 'send_attachment', action_params: [1, 2] }
|
||||
{ action_name: 'send_attachment', action_params: [1, 2] },
|
||||
{ action_name: 'send_webhook_event', action_params: ['https://example.com/webhook'] }
|
||||
])
|
||||
end
|
||||
|
||||
@@ -147,4 +148,11 @@ RSpec.describe Macros::ExecutionService, type: :service do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#send_webhook_event' do
|
||||
it 'sends a webhook event' do
|
||||
expect(WebhookJob).to receive(:perform_later)
|
||||
service.send(:send_webhook_event, ['https://example.com/webhook'])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user