lib/rambulance/test_helper.rb in rambulance-3.0.0 vs lib/rambulance/test_helper.rb in rambulance-3.1.0
- old
+ new
@@ -26,15 +26,19 @@
def with_exceptions_app(enabled: true)
org_show_detailed_exceptions = Rails.application.env_config['action_dispatch.show_detailed_exceptions']
org_show_exceptions = Rails.application.env_config['action_dispatch.show_exceptions']
Rails.application.env_config['action_dispatch.show_detailed_exceptions'] = !enabled
- Rails.application.env_config['action_dispatch.show_exceptions'] = enabled
+ if ActionDispatch::ExceptionWrapper.instance_methods.include?(:show?)
+ Rails.application.env_config['action_dispatch.show_exceptions'] = enabled ? :all : :none
+ else
+ Rails.application.env_config['action_dispatch.show_exceptions'] = enabled
+ end
+
yield
ensure
Rails.application.env_config['action_dispatch.show_detailed_exceptions'] = org_show_detailed_exceptions
Rails.application.env_config['action_dispatch.show_exceptions'] = org_show_exceptions
end
end
end
-