aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2015-12-31 09:04:42 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2015-12-31 09:04:42 +0100
commit4ff5f6a15bb8f89c07b396a81b825a4efaaecd29 (patch)
tree05cfa572efcfcf177f79a214af9cda13c0c294fb /actionpack/test
parentfb2132579ec73337fe0113f6c8a0c01c79ea020f (diff)
parent28f648dbc7e1523295a89b670db30c4542b8fb5a (diff)
downloadrails-4ff5f6a15bb8f89c07b396a81b825a4efaaecd29.tar.gz
rails-4ff5f6a15bb8f89c07b396a81b825a4efaaecd29.tar.bz2
rails-4ff5f6a15bb8f89c07b396a81b825a4efaaecd29.zip
Merge pull request #22850 from prathamesh-sonpatki/fix_ac_params_unsafe_h_2
Fix AC::Parameters#to_unsafe_h to return all unfiltered values
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/parameters/parameters_permit_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/controller/parameters/parameters_permit_test.rb b/actionpack/test/controller/parameters/parameters_permit_test.rb
index 598cac5156..896bda2597 100644
--- a/actionpack/test/controller/parameters/parameters_permit_test.rb
+++ b/actionpack/test/controller/parameters/parameters_permit_test.rb
@@ -298,6 +298,14 @@ class ParametersPermitTest < ActiveSupport::TestCase
assert_not @params.to_unsafe_h.is_a? ActionController::Parameters
end
+ test "to_unsafe_h returns unfiltered params even after accessing few keys" do
+ params = ActionController::Parameters.new("f"=>{"language_facet"=>["Tibetan"]})
+ expected = {"f"=>{"language_facet"=>["Tibetan"]}}
+
+ assert params['f'].is_a? ActionController::Parameters
+ assert_equal expected, params.to_unsafe_h
+ end
+
test "to_h only deep dups Ruby collections" do
company = Class.new do
attr_reader :dupped