chore: Provider API prototype (#3112)
Enabling Support for Whatsapp via 360Dialog as a prototype for the provider APIs. Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
12
spec/controllers/webhooks/whatsapp_controller_spec.rb
Normal file
12
spec/controllers/webhooks/whatsapp_controller_spec.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'Webhooks::WhatsappController', type: :request do
|
||||
describe 'POST /webhooks/whatsapp/{:phone_number}' do
|
||||
it 'call the whatsapp events job with the params' do
|
||||
allow(Webhooks::WhatsappEventsJob).to receive(:perform_later)
|
||||
expect(Webhooks::WhatsappEventsJob).to receive(:perform_later)
|
||||
post '/webhooks/whatsapp/123221321', params: { content: 'hello' }
|
||||
expect(response).to have_http_status(:success)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user