diff --git a/sentry-rails/spec/sentry/rails/activejob_spec.rb b/sentry-rails/spec/sentry/rails/activejob_spec.rb index 9e9e0ce36..cf986d937 100644 --- a/sentry-rails/spec/sentry/rails/activejob_spec.rb +++ b/sentry-rails/spec/sentry/rails/activejob_spec.rb @@ -309,21 +309,17 @@ def perform(event, hint) context "when we are using an adapter which has a specific integration" do before do - Sentry.configuration.rails.skippable_job_adapters = ["ActiveJob::QueueAdapters::SidekiqAdapter"] + Sentry.configuration.rails.skippable_job_adapters = ["ActiveJob::QueueAdapters::TestAdapter"] end - it "does not trigger sentry and re-raises" do - begin - original_queue_adapter = FailedJob.queue_adapter - FailedJob.queue_adapter = :sidekiq + after do + Sentry.configuration.rails.skippable_job_adapters = [] + end - expect { FailedJob.perform_now }.to raise_error(FailedJob::TestError) + it "does not trigger sentry and re-raises" do + expect { FailedJob.perform_now }.to raise_error(FailedJob::TestError) - expect(transport.events.size).to eq(0) - ensure - # this doesn't affect test result, but we shouldn't change it anyway - FailedJob.queue_adapter = original_queue_adapter - end + expect(transport.events.size).to eq(0) end end