Skip to content

Commit a9301f3

Browse files
Fix ActiveJob tests for Rails 7.2 and 8.0 (#2487)
1 parent 7ad595a commit a9301f3

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

sentry-rails/Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ gem "rails", "~> #{rails_version}"
2222

2323
if rails_version >= Gem::Version.new("8.0.0")
2424
gem "rspec-rails"
25-
gem "sqlite3", platform: :ruby
25+
gem "sqlite3", "~> 2.1.1", platform: :ruby
2626
elsif rails_version >= Gem::Version.new("7.1.0")
2727
gem "rspec-rails"
2828
gem "sqlite3", "~> 1.7.3", platform: :ruby

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class FailedJobWithCron < FailedJob
6868
end
6969

7070

71-
RSpec.describe "without Sentry initialized" do
71+
RSpec.describe "without Sentry initialized", type: :job do
7272
it "runs job" do
7373
expect { FailedJob.perform_now }.to raise_error(FailedJob::TestError)
7474
end
@@ -78,7 +78,7 @@ class FailedJobWithCron < FailedJob
7878
end
7979
end
8080

81-
RSpec.describe "ActiveJob integration" do
81+
RSpec.describe "ActiveJob integration", type: :job do
8282
before do
8383
make_basic_app
8484
end

sentry-rails/spec/spec_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
ENV.delete('RAILS_ENV')
5757
ENV.delete('RACK_ENV')
5858
end
59+
60+
config.include ActiveJob::TestHelper, type: :job
5961
end
6062

6163
def reload_send_event_job

0 commit comments

Comments
 (0)