test: fix spec
This commit is contained in:
parent
f9f0bdedb9
commit
a1d3d6befe
@ -81,12 +81,12 @@ RSpec.describe 'Webhooks::WhatsappController', type: :request do
|
||||
expect(response).to have_http_status(:unauthorized)
|
||||
end
|
||||
|
||||
it 'returns 400 when MessageNotFoundError is raised' do
|
||||
it 'returns 404 when MessageNotFoundError is raised' do
|
||||
allow(Webhooks::WhatsappEventsJob).to receive(:perform_now).and_raise(Whatsapp::IncomingMessageBaileysService::MessageNotFoundError)
|
||||
|
||||
post '/webhooks/whatsapp/123221321', params: { content: 'hello', awaitResponse: true }
|
||||
|
||||
expect(response).to have_http_status(:bad_request)
|
||||
expect(response).to have_http_status(:not_found)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user