Chatwoot/spec/jobs/account/conversations_resolution_scheduler_job_spec.rb
2021-11-27 09:26:18 +05:30

18 lines
546 B
Ruby

require 'rails_helper'
RSpec.describe Account::ConversationsResolutionSchedulerJob, type: :job do
subject(:job) { described_class.perform_later }
let!(:account) { create(:account) }
it 'enqueues the job' do
expect { job }.to have_enqueued_job(described_class)
.on_queue('scheduled_jobs')
end
it 'enqueues Conversations::ResolutionJob' do
account.update(auto_resolve_duration: 10)
expect(Conversations::ResolutionJob).to receive(:perform_later).with(account: account).once
described_class.perform_now
end
end