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.2.1.beta.3 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.1.beta.2 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.1.beta.1 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.0 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.0.beta.1 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.0.alpha.6 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.0.alpha.5 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.0.alpha.4 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.1.9 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.1.9.beta.2 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.1.9.beta.1 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.1.8 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.0.alpha.3 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.1.7 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.0.alpha.2 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.1.7.beta.2 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.2.0.alpha.1 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.1.7.beta.1 spec/lib/appsignal/integrations/resque_active_job_spec.rb