Sha256: 68ad6ed475ba2c3268db8349e16158be744303f51b122f8b64c438f7add085f8

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

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

6 entries across 6 versions & 1 rubygems

Version Path
appsignal-1.3.6 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.3.6.beta.1 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.3.5 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.3.5.beta.1 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.3.4 spec/lib/appsignal/integrations/resque_active_job_spec.rb
appsignal-1.3.3 spec/lib/appsignal/integrations/resque_active_job_spec.rb