iachat/spec/jobs/webhook_job_spec.rb
Sojan Jose 85e57c2e94
chore: Reorganize Sidekiq Queues (#6976)
- Rearrange and reprioritize current sidekiq queues
- Trim the unnecessary queues

ref: https://linear.app/chatwoot/issue/CW-1480/chore-run-all-sidekiq-jobs-async
2023-05-04 15:44:16 +05:30

22 lines
527 B
Ruby

require 'rails_helper'
RSpec.describe WebhookJob, type: :job do
include ActiveJob::TestHelper
subject(:job) { described_class.perform_later(url, payload) }
let(:url) { 'https://test.chatwoot.com' }
let(:payload) { { name: 'test' } }
it 'queues the job' do
expect { job }.to have_enqueued_job(described_class)
.with(url, payload)
.on_queue('medium')
end
it 'executes perform' do
expect(Webhooks::Trigger).to receive(:execute).with(url, payload)
perform_enqueued_jobs { job }
end
end