iachat/spec/jobs/delete_object_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

21 lines
515 B
Ruby

require 'rails_helper'
RSpec.describe DeleteObjectJob, type: :job do
subject(:job) { described_class.perform_later(account) }
let(:account) { create(:account) }
it 'enqueues the job' do
expect { job }.to have_enqueued_job(described_class)
.with(account)
.on_queue('low')
end
context 'when an object is passed to the job' do
it 'is deleted' do
described_class.perform_now(account)
expect { account.reload }.to raise_error(ActiveRecord::RecordNotFound)
end
end
end