diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2013-01-08 15:52:00 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2013-01-08 15:52:18 +0100 |
commit | ae3286b74346023a868d63c53cde562b1529ef2c (patch) | |
tree | 6635474cb1f8dc941ad477525201d20b1aea219b /actionpack/test | |
parent | 4f002a1df3ee37349e278ba64ef29602ee637ac5 (diff) | |
download | rails-ae3286b74346023a868d63c53cde562b1529ef2c.tar.gz rails-ae3286b74346023a868d63c53cde562b1529ef2c.tar.bz2 rails-ae3286b74346023a868d63c53cde562b1529ef2c.zip |
Never treat action or controller as unpermitted params
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/parameters/raise_on_unpermitted_parameters_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/parameters/raise_on_unpermitted_parameters_test.rb b/actionpack/test/controller/parameters/raise_on_unpermitted_parameters_test.rb index 747b8123ea..3cedc16730 100644 --- a/actionpack/test/controller/parameters/raise_on_unpermitted_parameters_test.rb +++ b/actionpack/test/controller/parameters/raise_on_unpermitted_parameters_test.rb @@ -30,4 +30,14 @@ class RaiseOnUnpermittedParametersTest < ActiveSupport::TestCase params.permit(book: [:pages]) end end + + test "action and controller keys are safe to ignore" do + params = ActionController::Parameters.new({ + action: 'index', controller: 'stuff', book: { pages: 65 } + }) + + assert_nothing_raised do + params.permit(book: [:pages]) + end + end end |