diff options
author | Jon Moss <me@jonathanmoss.me> | 2016-06-22 14:34:30 -0400 |
---|---|---|
committer | Jon Moss <me@jonathanmoss.me> | 2016-06-23 09:56:18 -0400 |
commit | 19eec522978348bcae8f733ee3dcdcffd5d4a2be (patch) | |
tree | 9e0737f769625f8261fa2b9de8521c0eb8587a1a /actionpack/test | |
parent | abec128cb501023f1b2d0327139b5cb0b670b5f1 (diff) | |
download | rails-19eec522978348bcae8f733ee3dcdcffd5d4a2be.tar.gz rails-19eec522978348bcae8f733ee3dcdcffd5d4a2be.tar.bz2 rails-19eec522978348bcae8f733ee3dcdcffd5d4a2be.zip |
`params.permitted?` is false by default
In the docs: "+permit_all_parameters+ - If it's +true+, all the parameters will
be permitted by default. The default is +false+."
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/parameters/parameters_permit_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/controller/parameters/parameters_permit_test.rb b/actionpack/test/controller/parameters/parameters_permit_test.rb index b75eb0e3bf..2eed2996f6 100644 --- a/actionpack/test/controller/parameters/parameters_permit_test.rb +++ b/actionpack/test/controller/parameters/parameters_permit_test.rb @@ -369,4 +369,10 @@ class ParametersPermitTest < ActiveSupport::TestCase refute params.permit(foo: [:bar]).has_key?(:foo) refute params.permit(foo: :bar).has_key?(:foo) end + + test '#permitted? is false by default' do + params = ActionController::Parameters.new + + assert_equal false, params.permitted? + end end |