From 3510b9b5e0e6f50c010bc3cc8edeca74c5b1d560 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Wed, 4 Dec 2024 15:21:56 +0100 Subject: [PATCH] Allow to set Rails deprecations behavior during tests Set the desired deprecation behavior via RAILS_DEPRECATIONS_BEHAVIOR ENV var. Defaults to :stderr. Possible values are - raise - Raise ActiveSupport::DeprecationException. - stderr - Log all deprecation warnings to $stderr. - log - Log all deprecation warnings to Rails.logger. - notify - Use ActiveSupport::Notifications to notify deprecation.rails. - report - Use ActiveSupport::ErrorReporter to report deprecations. - silence - Do nothing Refs: https://api.rubyonrails.org/classes/ActiveSupport/Deprecation/Behavior.html --- core/lib/spree/testing_support/dummy_app.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/spree/testing_support/dummy_app.rb b/core/lib/spree/testing_support/dummy_app.rb index 8b9c4591235..7e2e7707f20 100644 --- a/core/lib/spree/testing_support/dummy_app.rb +++ b/core/lib/spree/testing_support/dummy_app.rb @@ -80,7 +80,7 @@ class Application < ::Rails::Application config.action_dispatch.show_exceptions = false end config.consider_all_requests_local = true - config.active_support.deprecation = :stderr + config.active_support.deprecation = ENV['RAILS_DEPRECATIONS_BEHAVIOR'].presence&.to_sym || :stderr config.log_level = :debug # Improve test suite performance: