diff --git a/spec/dummy/config/environments/test.rb b/spec/dummy/config/environments/test.rb index 40c2d83805..acb102b502 100644 --- a/spec/dummy/config/environments/test.rb +++ b/spec/dummy/config/environments/test.rb @@ -33,7 +33,7 @@ config.cache_store = :null_store # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = ENV.fetch("RAILS_VERSION", "7.1") == "7.1" ? :none : false + config.action_dispatch.show_exceptions = Rails.gem_version >= Gem::Version.new("7.1") ? :none : false # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = true