Some checks failed
Lock Threads / action (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot EE docker images / merge (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot CE docker images / merge (push) Has been cancelled
Run Chatwoot CE spec / lint-backend (push) Has been cancelled
Run Chatwoot CE spec / lint-frontend (push) Has been cancelled
Run Chatwoot CE spec / frontend-tests (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (0, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (1, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (10, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (11, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (12, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (13, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (14, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (15, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (2, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (3, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (4, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (5, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (6, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (7, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (8, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (9, 16) (push) Has been cancelled
Run Linux nightly installer / nightly (push) Has been cancelled
- Add Logistics component with progress tracking - Add OrderDetail component for order information - Support data-driven steps and actions - Add blue color scale to widget SCSS - Fix node overflow and progress bar rendering issues - Add English translations for dashboard components Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
51 lines
1.7 KiB
Ruby
51 lines
1.7 KiB
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe Channels::Twilio::TemplatesSyncJob do
|
|
let!(:account) { create(:account) }
|
|
let!(:twilio_channel) { create(:channel_twilio_sms, medium: :whatsapp, account: account) }
|
|
|
|
it 'enqueues the job' do
|
|
expect { described_class.perform_later(twilio_channel) }.to have_enqueued_job(described_class)
|
|
.on_queue('low')
|
|
.with(twilio_channel)
|
|
end
|
|
|
|
describe '#perform' do
|
|
let(:template_sync_service) { instance_double(Twilio::TemplateSyncService) }
|
|
|
|
context 'with successful template sync' do
|
|
it 'creates and calls the template sync service' do
|
|
expect(Twilio::TemplateSyncService).to receive(:new).with(channel: twilio_channel).and_return(template_sync_service)
|
|
expect(template_sync_service).to receive(:call).and_return(true)
|
|
|
|
described_class.perform_now(twilio_channel)
|
|
end
|
|
end
|
|
|
|
context 'with template sync exception' do
|
|
let(:error_message) { 'Twilio API error' }
|
|
|
|
before do
|
|
allow(Twilio::TemplateSyncService).to receive(:new).with(channel: twilio_channel).and_return(template_sync_service)
|
|
allow(template_sync_service).to receive(:call).and_raise(StandardError, error_message)
|
|
end
|
|
|
|
it 'does not suppress the exception' do
|
|
expect { described_class.perform_now(twilio_channel) }.to raise_error(StandardError, error_message)
|
|
end
|
|
end
|
|
|
|
context 'with nil channel' do
|
|
it 'handles nil channel gracefully' do
|
|
expect { described_class.perform_now(nil) }.to raise_error(NoMethodError)
|
|
end
|
|
end
|
|
end
|
|
|
|
describe 'job configuration' do
|
|
it 'is configured to run on low priority queue' do
|
|
expect(described_class.queue_name).to eq('low')
|
|
end
|
|
end
|
|
end
|