aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2014-11-25 03:01:11 -0800
committerGodfrey Chan <godfreykfc@gmail.com>2014-11-25 03:05:42 -0800
commitf2a0567b314de7468d5fa16ccb0e11b41d9f4297 (patch)
tree173f6d914f5f9a5406f3af9279bc19e3ca98015b /railties/test
parent6ea7065a18671872f1486cff3fdaeb4f78fa6332 (diff)
downloadrails-f2a0567b314de7468d5fa16ccb0e11b41d9f4297.tar.gz
rails-f2a0567b314de7468d5fa16ccb0e11b41d9f4297.tar.bz2
rails-f2a0567b314de7468d5fa16ccb0e11b41d9f4297.zip
Added tests for log_level deprecation
Closes #17756 [Godfrey Chan, Zachary Scott]
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/configuration_test.rb31
1 files changed, 18 insertions, 13 deletions
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