Sha256: 415a3ebf7cebef0d1715422286eeb5ee669c542c0cd04969f6e7b9a3e63be0dc

Contents?: true

Size: 755 Bytes

Versions: 2

Compression:

Stored size: 755 Bytes

Contents

require "spec_helper"

describe Qe::EnqueueMatcher do
  HelloWorker = Class.new { include Qe::Worker }

  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

2 entries across 2 versions & 1 rubygems

Version Path
qe-0.2.0 spec/qe/enqueue_matcher_spec.rb
qe-0.1.3 spec/qe/enqueue_matcher_spec.rb