Skip to content

Commit

Permalink
Fix ActiveJob tests for Rails 7.2 and 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-thatch committed Jan 2, 2025
1 parent 7ad595a commit 7e69e17
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sentry-rails/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions sentry-rails/spec/sentry/rails/activejob_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions sentry-rails/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7e69e17

Please sign in to comment.