fix: revert Twilio message creation using create! instead of create (#118)

This commit is contained in:
Gabriel Jablonski 2025-10-14 14:43:05 -03:00 committed by GitHub
parent 96d1003548
commit 9cd3edb497
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -52,7 +52,7 @@ class Channel::TwilioSms < ApplicationRecord
params = send_message_from.merge(to: to, body: body)
params[:media_url] = media_url if media_url.present?
params[:status_callback] = twilio_delivery_status_index_url
client.messages.create!(**params)
client.messages.create(**params) # rubocop:disable Rails/SaveBang
end
private

View File

@ -43,7 +43,7 @@ RSpec.describe Channel::TwilioSms do
end
it 'sends via twilio client' do
expect(twilio_messages).to receive(:create!).with(
expect(twilio_messages).to receive(:create).with(
messaging_service_sid: channel.messaging_service_sid,
to: '+15555550111',
body: 'hello world',
@ -57,7 +57,7 @@ RSpec.describe Channel::TwilioSms do
let(:channel) { create(:channel_twilio_sms, :with_phone_number) }
it 'sends via twilio client' do
expect(twilio_messages).to receive(:create!).with(
expect(twilio_messages).to receive(:create).with(
from: channel.phone_number,
to: '+15555550111',
body: 'hello world',
@ -70,7 +70,7 @@ RSpec.describe Channel::TwilioSms do
context 'with media urls' do
it 'supplies a media url' do
expect(twilio_messages).to receive(:create!).with(
expect(twilio_messages).to receive(:create).with(
messaging_service_sid: channel.messaging_service_sid,
to: '+15555550111',
body: 'hello world',