From a9301f39bf716d890a702e0c8b17c8ff9059f1f3 Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Thu, 2 Jan 2025 13:02:40 -0800 Subject: [PATCH] Fix ActiveJob tests for Rails 7.2 and 8.0 (#2487) --- sentry-rails/Gemfile | 2 +- sentry-rails/spec/sentry/rails/activejob_spec.rb | 4 ++-- sentry-rails/spec/spec_helper.rb | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sentry-rails/Gemfile b/sentry-rails/Gemfile index 5000bb3b2..53cfb92d7 100644 --- a/sentry-rails/Gemfile +++ b/sentry-rails/Gemfile @@ -22,7 +22,7 @@ gem "rails", "~> #{rails_version}" if rails_version >= Gem::Version.new("8.0.0") gem "rspec-rails" - gem "sqlite3", platform: :ruby + gem "sqlite3", "~> 2.1.1", platform: :ruby elsif rails_version >= Gem::Version.new("7.1.0") gem "rspec-rails" gem "sqlite3", "~> 1.7.3", platform: :ruby diff --git a/sentry-rails/spec/sentry/rails/activejob_spec.rb b/sentry-rails/spec/sentry/rails/activejob_spec.rb index cf986d937..ffcb4d44c 100644 --- a/sentry-rails/spec/sentry/rails/activejob_spec.rb +++ b/sentry-rails/spec/sentry/rails/activejob_spec.rb @@ -68,7 +68,7 @@ class FailedJobWithCron < FailedJob end -RSpec.describe "without Sentry initialized" do +RSpec.describe "without Sentry initialized", type: :job do it "runs job" do expect { FailedJob.perform_now }.to raise_error(FailedJob::TestError) end @@ -78,7 +78,7 @@ class FailedJobWithCron < FailedJob end end -RSpec.describe "ActiveJob integration" do +RSpec.describe "ActiveJob integration", type: :job do before do make_basic_app end diff --git a/sentry-rails/spec/spec_helper.rb b/sentry-rails/spec/spec_helper.rb index 68b7d5a04..5928e7134 100644 --- a/sentry-rails/spec/spec_helper.rb +++ b/sentry-rails/spec/spec_helper.rb @@ -56,6 +56,8 @@ ENV.delete('RAILS_ENV') ENV.delete('RACK_ENV') end + + config.include ActiveJob::TestHelper, type: :job end def reload_send_event_job