houdini/spec/lib/email_job_queue_spec.rb

18 lines
No EOL
546 B
Ruby

require "rails_helper"
describe EmailJobQueue do
let(:klass) { class_double("FakeClass")}
let(:fake_object) { instance_double('FakeClass') }
it 'handles empty args' do
expect(klass).to receive(:new).and_return(fake_object)
expect(Delayed::Job).to receive(:enqueue).with(fake_object)
EmailJobQueue.queue(klass)
end
it 'handles other args' do
expect(klass).to receive(:new).with(1, 2).and_return(fake_object)
expect(Delayed::Job).to receive(:enqueue).with(fake_object)
EmailJobQueue.queue(klass, 1, 2)
end
end