diff options
author | Prem Sichanugrist <s@sikac.hu> | 2015-12-14 09:52:52 -0500 |
---|---|---|
committer | Prem Sichanugrist <s@sikac.hu> | 2015-12-14 10:28:54 -0500 |
commit | 6d4aef984c0cd74ebd92b8d18a8e68f371fbb944 (patch) | |
tree | 2c692655134cdd6d74adf17c5a508a22592e0fc3 /actionpack/test | |
parent | 2dd64a7bbb0cb7b65976cb0516d0f338b099a715 (diff) | |
download | rails-6d4aef984c0cd74ebd92b8d18a8e68f371fbb944.tar.gz rails-6d4aef984c0cd74ebd92b8d18a8e68f371fbb944.tar.bz2 rails-6d4aef984c0cd74ebd92b8d18a8e68f371fbb944.zip |
Make Parameters#to_h and #to_unsafe_h return HWIA
This makes these two methods to be more inline with the previous
behavior of Parameters as Parameters used to be inherited from HWIA.
Fixes #21391
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/parameters/parameters_permit_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/test/controller/parameters/parameters_permit_test.rb b/actionpack/test/controller/parameters/parameters_permit_test.rb index 9f7d14e85d..87816515e7 100644 --- a/actionpack/test/controller/parameters/parameters_permit_test.rb +++ b/actionpack/test/controller/parameters/parameters_permit_test.rb @@ -256,7 +256,7 @@ class ParametersPermitTest < ActiveSupport::TestCase end test "to_h returns empty hash on unpermitted params" do - assert @params.to_h.is_a? Hash + assert @params.to_h.is_a? ActiveSupport::HashWithIndifferentAccess assert_not @params.to_h.is_a? ActionController::Parameters assert @params.to_h.empty? end @@ -264,7 +264,7 @@ class ParametersPermitTest < ActiveSupport::TestCase test "to_h returns converted hash on permitted params" do @params.permit! - assert @params.to_h.is_a? Hash + assert @params.to_h.is_a? ActiveSupport::HashWithIndifferentAccess assert_not @params.to_h.is_a? ActionController::Parameters end @@ -273,7 +273,7 @@ class ParametersPermitTest < ActiveSupport::TestCase ActionController::Parameters.permit_all_parameters = true params = ActionController::Parameters.new(crab: "Senjougahara Hitagi") - assert params.to_h.is_a? Hash + assert params.to_h.is_a? ActiveSupport::HashWithIndifferentAccess assert_not @params.to_h.is_a? ActionController::Parameters assert_equal({ "crab" => "Senjougahara Hitagi" }, params.to_h) ensure @@ -294,7 +294,7 @@ class ParametersPermitTest < ActiveSupport::TestCase end test "to_unsafe_h returns unfiltered params" do - assert @params.to_h.is_a? Hash + assert @params.to_h.is_a? ActiveSupport::HashWithIndifferentAccess assert_not @params.to_h.is_a? ActionController::Parameters end end |