Chatwoot/spec/controllers/twilio/callbacks_controller_spec.rb
Pranav Raj S a1a81e3799
Feature: Twilio SMS Channel (#658)
Twilio SMS Channel
Fixes :  #350
2020-04-05 22:11:27 +05:30

18 lines
568 B
Ruby

require 'rails_helper'
RSpec.describe 'Twilio::CallbacksController', type: :request do
include Rails.application.routes.url_helpers
let(:twilio_service) { instance_double(Twilio::IncomingMessageService) }
before do
allow(::Twilio::IncomingMessageService).to receive(:new).and_return(twilio_service)
allow(twilio_service).to receive(:perform)
end
describe 'GET /twilio/callback' do
it 'calls incoming message service' do
post twilio_callback_index_url, params: {}
expect(twilio_service).to have_received(:perform)
end
end
end