Sha256: b89b9fa5107f50fd95a2b55a7d625c5c974343e4b1335e27675a27d4d42e3d5e

Contents?: true

Size: 1.06 KB

Versions: 38

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'

if resque_present? && active_job_present?
  describe "Resque ActiveJob integration" do
    let(:file) { File.expand_path('lib/appsignal/integrations/resque_active_job.rb') }

    context "with Resque and ActiveJob" do
      before do
        load file
        start_agent

        class TestActiveJob < ActiveJob::Base
          include Appsignal::Integrations::ResqueActiveJobPlugin

          def perform(param)
          end
        end
      end

      describe :around_perform_plugin do
        before    { SecureRandom.stub(:uuid => 123) }
        let(:job) { TestActiveJob.new('moo') }

        it "should wrap in a transaction with the correct params" do
          Appsignal.should_receive(:monitor_single_transaction).with(
            'perform_job.resque',
            :class  => 'TestActiveJob',
            :method => 'perform',
            :params => ['moo'],
            :metadata => {
              :id    => 123,
              :queue => 'default'
            }
          )
        end
        after { job.perform_now }
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
appsignal-1.4.0.alpha.2 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.4.0.alpha.1 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.3.2 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.3.1 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.3.0 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.3.0.beta.3 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.3.0.beta.2 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.3.0.beta.1 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.5 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.4 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.4.beta.4 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.4.beta.3 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.4.beta.2 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.4.beta.1 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.3 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.3.beta.3 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.3.beta.2 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.3.beta.1 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.2 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.1 spec/lib/appsignal/integrations/resque_active_job_spec.rb