Sha256: b77e539e127b9d50b73b6fdf51b207b61e15af513216861faa3278e8174db26a

Contents?: true

Size: 705 Bytes

Versions: 8

Compression:

Stored size: 705 Bytes

Contents

require "spec_helper"

describe Qe::EnqueueMatcher do
  it "sets adapter" do
    expect(Qe.adapter).to eql(Qe::Testing)
  end

  it "enqueues job with options" do
    expect {
      HelloWorker.enqueue(:message => "hello")
    }.to enqueue(HelloWorker).with(:message => "hello")
  end

  it "enqueues job without options" do
    expect {
      HelloWorker.enqueue
    }.to enqueue(HelloWorker)
  end

  it "doesn't enqueue job with options" do
    expect {
      HelloWorker.enqueue
    }.not_to enqueue(HelloWorker).with(:a => 1)
  end

  it "enqueues job with options but matches it without options" do
    expect {
      HelloWorker.enqueue(:message => "hello")
    }.to enqueue(HelloWorker)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
qe-0.4.0 spec/qe/enqueue_matcher_spec.rb
qe-0.3.5 spec/qe/enqueue_matcher_spec.rb
qe-0.3.4 spec/qe/enqueue_matcher_spec.rb
qe-0.3.3 spec/qe/enqueue_matcher_spec.rb
qe-0.3.2 spec/qe/enqueue_matcher_spec.rb
qe-0.3.1 spec/qe/enqueue_matcher_spec.rb
qe-0.3.0 spec/qe/enqueue_matcher_spec.rb
qe-0.2.1 spec/qe/enqueue_matcher_spec.rb