Sha256: 2fd289665454b659f19f304ad7808c48913e516c067362018458dd0a5aefd529

Contents?: true

Size: 778 Bytes

Versions: 17

Compression:

Stored size: 778 Bytes

Contents

require 'spec_helper'
require 'pwwka/queue_resque_job_handler'

class MyTestJob
end

describe Pwwka::QueueResqueJobHandler do

  describe "::handle!" do
    let(:job_class) { MyTestJob }
    let(:delivery_info) { double("delivery info") }
    let(:properties) { double("properties") }
    let(:payload) {
      {
        "this" => "is",
        "some" => true,
        "payload" => 99,
      }
    }

    before do
      allow(Resque).to receive(:enqueue)
      ENV["JOB_KLASS"] = MyTestJob.name

      described_class.handle!(delivery_info,properties,payload)
    end

    it "should queue a resque job using JOB_KLASS and payload" do
      expect(Resque).to have_received(:enqueue).with(MyTestJob,payload)
    end

    after do
      ENV.delete("JOB_KLASS")
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
pwwka-0.11.0 spec/unit/queue_resque_job_handler_spec.rb
pwwka-0.11.0.RC1 spec/unit/queue_resque_job_handler_spec.rb
pwwka-0.10.0 spec/unit/queue_resque_job_handler_spec.rb
pwwka-0.10.0.RC spec/unit/queue_resque_job_handler_spec.rb
pwwka-0.9.0 spec/unit/queue_resque_job_handler_spec.rb
pwwka-0.9.0.RC1 spec/unit/queue_resque_job_handler_spec.rb
pwwka-0.8.0 spec/queue_resque_job_handler_spec.rb
pwwka-0.8.0.RC1 spec/queue_resque_job_handler_spec.rb
pwwka-0.7.0.RC1 spec/queue_resque_job_handler_spec.rb
pwwka-0.7.0 spec/queue_resque_job_handler_spec.rb
pwwka-0.6.0 spec/queue_resque_job_handler_spec.rb
pwwka-0.5.2 spec/queue_resque_job_handler_spec.rb
pwwka-0.5.1 spec/queue_resque_job_handler_spec.rb
pwwka-0.5.0 spec/queue_resque_job_handler_spec.rb
pwwka-0.4.2 spec/queue_resque_job_handler_spec.rb
pwwka-0.4.1 spec/queue_resque_job_handler_spec.rb
pwwka-0.4.0 spec/queue_resque_job_handler_spec.rb