Skip to content

Commit af91c55

Browse files
committed
Fix error expectation tests on Rails 7.2+
Rails 7.2 changed the default for show_exceptions in tests from false to :rescuable, causing exceptions during requests to be rescued instead of raised. Explicitly disable exception handling in tests.
1 parent 4e26907 commit af91c55

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

spec/rails_helper.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
require 'combustion'
55
Combustion.initialize!(:active_record, :action_controller, :action_view, :sprockets)
66

7+
if Rails.version >= '7.1'
8+
Rails.application.config.action_dispatch.show_exceptions = :none
9+
else
10+
Rails.application.config.action_dispatch.show_exceptions = false
11+
end
12+
713
require 'rspec/rails'
814
require 'support/reset_settings'
915

0 commit comments

Comments
 (0)