aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2017-07-05 12:20:31 -0400
committerRafael Mendonça França <rafaelmfranca@gmail.com>2017-07-05 12:21:55 -0400
commit056ffa42af077ca3f21a6e32f0ba8c6f61e3d6c4 (patch)
treea12c8d32055e7a67020352f9d20ccd992d2de61c /railties
parentfed2557e3038f7747fc716b166e68b80a88d1ee1 (diff)
downloadrails-056ffa42af077ca3f21a6e32f0ba8c6f61e3d6c4.tar.gz
rails-056ffa42af077ca3f21a6e32f0ba8c6f61e3d6c4.tar.bz2
rails-056ffa42af077ca3f21a6e32f0ba8c6f61e3d6c4.zip
Force ActionController::Base lazy laod hooks to run
Now that the parameters configurations are only loaded when ActionController::Base is we need to foce them to load in our tests. In an application this is not needed since every request already load the controllers.
Diffstat (limited to 'railties')
-rw-r--r--railties/test/application/configuration_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index 95a2cc2d31..9bfc266dd4 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -1130,6 +1130,8 @@ module ApplicationTests
app "development"
+ ActionController::Base.object_id # force lazy load hooks to run
+
assert_equal :raise, ActionController::Parameters.action_on_unpermitted_parameters
post "/posts", post: { "title" => "zomg" }
@@ -1148,6 +1150,8 @@ module ApplicationTests
app "development"
+ ActionController::Base.object_id # force lazy load hooks to run
+
assert_equal %w( controller action format ), ActionController::Parameters.always_permitted_parameters
end
@@ -1170,6 +1174,8 @@ module ApplicationTests
app "development"
+ ActionController::Base.object_id # force lazy load hooks to run
+
assert_equal :raise, ActionController::Parameters.action_on_unpermitted_parameters
post "/posts", post: { "title" => "zomg" }, format: "json"
@@ -1179,18 +1185,24 @@ module ApplicationTests
test "config.action_controller.action_on_unpermitted_parameters is :log by default on development" do
app "development"
+ ActionController::Base.object_id # force lazy load hooks to run
+
assert_equal :log, ActionController::Parameters.action_on_unpermitted_parameters
end
test "config.action_controller.action_on_unpermitted_parameters is :log by default on test" do
app "test"
+ ActionController::Base.object_id # force lazy load hooks to run
+
assert_equal :log, ActionController::Parameters.action_on_unpermitted_parameters
end
test "config.action_controller.action_on_unpermitted_parameters is false by default on production" do
app "production"
+ ActionController::Base.object_id # force lazy load hooks to run
+
assert_equal false, ActionController::Parameters.action_on_unpermitted_parameters
end