From f2a0567b314de7468d5fa16ccb0e11b41d9f4297 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Tue, 25 Nov 2014 03:01:11 -0800 Subject: Added tests for log_level deprecation Closes #17756 [Godfrey Chan, Zachary Scott] --- railties/test/application/configuration_test.rb | 31 ++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'railties') diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index f97be6e91d..1f97807f8c 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -967,28 +967,33 @@ module ApplicationTests end end - test "Not setting config.log_level is not deprecated for non-production environment" do - build_app - remove_from_config "config.log_level = .*" + test "Blank config.log_level is not deprecated for non-production environment" do with_rails_env "development" do - assert_not_deprecated(/log_level/) { require "#{app_path}/config/environment" } + assert_not_deprecated do + make_basic_app do |app| + app.config.log_level = nil + end + end end end - test "Not setting config.log_level is deprecated for the production environment" do - build_app - remove_from_config "config.log_level = .*" + test "Blank config.log_level is deprecated for the production environment" do with_rails_env "production" do - assert_deprecated(/log_level/) { require "#{app_path}/config/environment" } + assert_deprecated(/log_level/) do + make_basic_app do |app| + app.config.log_level = nil + end + end end end - test "Setting config.log_level removes the deprecation warning" do - build_app - remove_from_config "config.log_level = .*" - add_to_env_config "production", "config.log_level = :info" + test "Not blank config.log_level is not deprecated for the production environment" do with_rails_env "production" do - assert_not_deprecated(/log_level/) { require "#{app_path}/config/environment" } + assert_not_deprecated do + make_basic_app do |app| + app.config.log_level = :info + end + end end end -- cgit v1.2.3