From 1aa522dc4e00fdd54b1e1e38ad74311483849fcb Mon Sep 17 00:00:00 2001 From: Brendan Loudermilk Date: Thu, 4 Oct 2012 11:51:08 -0700 Subject: ActionController::Parameters#permit! is recursive --- actionpack/test/controller/parameters/parameters_permit_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionpack/test') 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 -- cgit v1.2.3