diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2013-01-08 16:10:34 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2013-01-08 16:17:30 +0100 |
commit | cc1c3c5be061e7572018f734e5239750ab449e3f (patch) | |
tree | 6ad30a930c58317510bfcd5c2d6f47ac74cb01a7 /railties/test/application | |
parent | ae3286b74346023a868d63c53cde562b1529ef2c (diff) | |
download | rails-cc1c3c5be061e7572018f734e5239750ab449e3f.tar.gz rails-cc1c3c5be061e7572018f734e5239750ab449e3f.tar.bz2 rails-cc1c3c5be061e7572018f734e5239750ab449e3f.zip |
Revert "unpermitted params" exception -- it's just not going to work. See the discussion on https://github.com/rails/strong_parameters/pull/75.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/configuration_test.rb | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 654a44e648..f9108ed7b9 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -577,54 +577,6 @@ module ApplicationTests assert_equal 'permitted', last_response.body end - test "config.action_controller.raise_on_unpermitted_parameters = true" do - app_file 'app/controllers/posts_controller.rb', <<-RUBY - class PostsController < ActionController::Base - def create - render text: params.require(:post).permit(:name) - end - end - RUBY - - add_to_config <<-RUBY - routes.prepend do - resources :posts - end - config.action_controller.raise_on_unpermitted_parameters = true - RUBY - - require "#{app_path}/config/environment" - - assert_equal true, ActionController::Parameters.raise_on_unpermitted_parameters - - post "/posts", {post: {"title" =>"zomg"}} - assert_match "We're sorry, but something went wrong", last_response.body - end - - test "config.action_controller.raise_on_unpermitted_parameters is true by default on development" do - ENV["RAILS_ENV"] = "development" - - require "#{app_path}/config/environment" - - assert_equal true, ActionController::Parameters.raise_on_unpermitted_parameters - end - - test "config.action_controller.raise_on_unpermitted_parameters is true by defaul on test" do - ENV["RAILS_ENV"] = "test" - - require "#{app_path}/config/environment" - - assert_equal true, ActionController::Parameters.raise_on_unpermitted_parameters - end - - test "config.action_controller.raise_on_unpermitted_parameters is false by default on production" do - ENV["RAILS_ENV"] = "production" - - require "#{app_path}/config/environment" - - assert_equal false, ActionController::Parameters.raise_on_unpermitted_parameters - end - test "config.action_dispatch.ignore_accept_header" do make_basic_app do |app| app.config.action_dispatch.ignore_accept_header = true |