aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/parameters
diff options
context:
space:
mode:
authorBrendan Loudermilk <brendan@gophilosophie.com>2012-10-04 11:51:08 -0700
committerBrendan Loudermilk <brendan@gophilosophie.com>2012-10-04 11:51:08 -0700
commit1aa522dc4e00fdd54b1e1e38ad74311483849fcb (patch)
treedcd4fd6d81b74873b256427092ba8a40ef5db39e /actionpack/test/controller/parameters
parentb0a7068564f0c95e7ef28fc39d0335ed17d93e90 (diff)
downloadrails-1aa522dc4e00fdd54b1e1e38ad74311483849fcb.tar.gz
rails-1aa522dc4e00fdd54b1e1e38ad74311483849fcb.tar.bz2
rails-1aa522dc4e00fdd54b1e1e38ad74311483849fcb.zip
ActionController::Parameters#permit! is recursive
Diffstat (limited to 'actionpack/test/controller/parameters')
-rw-r--r--actionpack/test/controller/parameters/parameters_permit_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/controller/parameters/parameters_permit_test.rb b/actionpack/test/controller/parameters/parameters_permit_test.rb
index 7fe8e6051b..18bb51c5a3 100644
--- a/actionpack/test/controller/parameters/parameters_permit_test.rb
+++ b/actionpack/test/controller/parameters/parameters_permit_test.rb
@@ -57,6 +57,13 @@ class ParametersPermitTest < ActiveSupport::TestCase
assert_equal @params.permitted?, @params.dup.permitted?
end
+ test "permit is recursive" do
+ @params.permit!
+ assert @params.permitted?
+ assert @params[:person].permitted?
+ assert @params[:person][:name].permitted?
+ end
+
test "permitted takes a default value when Parameters.permit_all_parameters is set" do
begin
ActionController::Parameters.permit_all_parameters = true