houdini/spec/lib/email_job_queue_spec.rb

19 lines
635 B
Ruby
Raw Normal View History

# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
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