aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-06-19 19:53:40 -0400
committerGitHub <noreply@github.com>2017-06-19 19:53:40 -0400
commit09cb26bc1e653999827cf3eb955d42a2c932b3f5 (patch)
tree54338924d202d273cf334e4c2cfccd38f8ba878d /actionpack/test
parenta9bb9d7abc59d497d443d463544d5d859d08463b (diff)
parent095036467e4e06e56452da94077500d428dd0eed (diff)
downloadrails-09cb26bc1e653999827cf3eb955d42a2c932b3f5.tar.gz
rails-09cb26bc1e653999827cf3eb955d42a2c932b3f5.tar.bz2
rails-09cb26bc1e653999827cf3eb955d42a2c932b3f5.zip
Merge pull request #27990 from leonelgalan/bug/filtered_parameters_class
Use of ParameterFilter no longer forces `request.filtered_parameters' class to be Hash
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/request_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb
index 28cbde028d..899b27b962 100644
--- a/actionpack/test/dispatch/request_test.rb
+++ b/actionpack/test/dispatch/request_test.rb
@@ -1098,6 +1098,19 @@ class RequestParameterFilter < BaseRequestTest
end
end
+ test "parameter filter should maintain hash with indifferent access" do
+ test_hashes = [
+ [{ "foo" => "bar" }.with_indifferent_access, ["blah"]],
+ [{ "foo" => "bar" }.with_indifferent_access, []]
+ ]
+
+ test_hashes.each do |before_filter, filter_words|
+ parameter_filter = ActionDispatch::Http::ParameterFilter.new(filter_words)
+ assert_instance_of ActiveSupport::HashWithIndifferentAccess,
+ parameter_filter.filter(before_filter)
+ end
+ end
+
test "filtered_parameters returns params filtered" do
request = stub_request(
"action_dispatch.request.parameters" => {