Chatwoot/spec/jobs/delete_object_job_spec.rb
Sojan Jose ad83d1bb71
feat: Platform API improvements (#2900)
- Platform APIs to add and update custom attributes to users
- Platform APIs to delete accounts
- Platform APIs to delete users
2021-09-02 18:29:45 +05:30

20 lines
519 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('default')
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