Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify ActiveJob specs setup #2445

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions sentry-rails/spec/sentry/rails/activejob_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading