diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-07-05 12:24:09 -0400 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-07-05 12:24:09 -0400 |
commit | 2ae84d2fa09af85166f35ca44238a6a20d3c1554 (patch) | |
tree | 26dc5eb3e145fc4f50c67adbfaa40de87eefe8d2 /railties | |
parent | 056ffa42af077ca3f21a6e32f0ba8c6f61e3d6c4 (diff) | |
parent | 458a5502a17ccf58d5708a3b030ac9917a0a8476 (diff) | |
download | rails-2ae84d2fa09af85166f35ca44238a6a20d3c1554.tar.gz rails-2ae84d2fa09af85166f35ca44238a6a20d3c1554.tar.bz2 rails-2ae84d2fa09af85166f35ca44238a6a20d3c1554.zip |
Merge pull request #29677 from eugeneius/parameters_configuration_tests
Fix Parameters configuration integration tests
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/configuration_test.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 9bfc266dd4..983ea5c3e6 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -1140,6 +1140,9 @@ module ApplicationTests test "config.action_controller.always_permitted_parameters are: controller, action by default" do app "development" + + ActionController::Base.object_id # force lazy load hooks to run + assert_equal %w(controller action), ActionController::Parameters.always_permitted_parameters end @@ -1206,6 +1209,39 @@ module ApplicationTests assert_equal false, ActionController::Parameters.action_on_unpermitted_parameters end + test "config.action_controller.permit_all_parameters can be configured in an initializer" do + app_file "config/initializers/permit_all_parameters.rb", <<-RUBY + Rails.application.config.action_controller.permit_all_parameters = true + RUBY + + app "development" + + ActionController::Base.object_id # force lazy load hooks to run + assert_equal true, ActionController::Parameters.permit_all_parameters + end + + test "config.action_controller.always_permitted_parameters can be configured in an initializer" do + app_file "config/initializers/always_permitted_parameters.rb", <<-RUBY + Rails.application.config.action_controller.always_permitted_parameters = [] + RUBY + + app "development" + + ActionController::Base.object_id # force lazy load hooks to run + assert_equal [], ActionController::Parameters.always_permitted_parameters + end + + test "config.action_controller.action_on_unpermitted_parameters can be configured in an initializer" do + app_file "config/initializers/action_on_unpermitted_parameters.rb", <<-RUBY + Rails.application.config.action_controller.action_on_unpermitted_parameters = :raise + RUBY + + app "development" + + ActionController::Base.object_id # force lazy load hooks to run + assert_equal :raise, ActionController::Parameters.action_on_unpermitted_parameters + end + test "config.action_dispatch.ignore_accept_header" do make_basic_app do |application| application.config.action_dispatch.ignore_accept_header = true |