Skip to content

Commit dc38bb6

Browse files
committed
Move spec-specific worker to its spec context
1 parent 4e59569 commit dc38bb6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

sentry-rails/spec/sentry/rails/activejob_spec.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ class FailedJobWithCron < FailedJob
6767
sentry_monitor_check_ins slug: "failed_job", monitor_config: Sentry::Cron::MonitorConfig.from_crontab("5 * * * *")
6868
end
6969

70-
class FailedJobWithRetryOn < FailedJob
71-
if respond_to? :retry_on
72-
retry_on StandardError, attempts: 3, wait: 0
73-
end
74-
end
75-
7670
RSpec.describe "without Sentry initialized", type: :job do
7771
it "runs job" do
7872
expect { FailedJob.perform_now }.to raise_error(FailedJob::TestError)
@@ -435,6 +429,10 @@ def perform(event, hint)
435429
end
436430

437431
describe "active_job_report_after_job_retries", skip: RAILS_VERSION < 7.0 do
432+
class FailedJobWithRetryOn < FailedJob
433+
retry_on StandardError, attempts: 3, wait: 0
434+
end
435+
438436
context "when active_job_report_after_job_retries is false" do
439437
it "reports 3 exceptions" do
440438
allow(Sentry::Rails::ActiveJobExtensions::SentryReporter)

0 commit comments

Comments
 (0)