Sha256: bcf170a96e41410904ddabf603cef02816afe0347b2e3e0918e9d796ba20635c

Contents?: true

Size: 755 Bytes

Versions: 1

Compression:

Stored size: 755 Bytes

Contents

require "spec_helper"

describe ActiveJob::DispatchRider::JobHandler do

  let!(:job_class) {
    job_class = Class.new(ActiveJob::Base) do
      queue_as :foo

      def perform(options)
        "foo is #{options[:foo]}"
      end
    end

    stub_const "AjJob", job_class

    AjJob
  }

  let(:job_data) {
    {
      "job_class" => "AjJob",
      "job_id" => "8b71ac6b-2854-4287-8d1b-15085b70280b",
      "queue_name" => "foo",
      "arguments" => [
        {
          "foo" => "bar",
          "_aj_symbol_keys" => ["foo"]
        }
      ],
      "guid" => "8b71ac6b-2854-4287-8d1b-15085b70280b",
    }
  }

  subject(:job_handler) { described_class.new }

  it("performs the job") { expect(job_handler.process job_data).to eq "foo is bar" }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activejob-dispatch_rider-2.4.1 spec/activejob/dispatch_rider/job_handler_spec.rb