diff options
author | Bernard Potocki <bernard.potocki@imanel.org> | 2013-12-05 12:08:34 +0100 |
---|---|---|
committer | Bernard Potocki <bernard.potocki@imanel.org> | 2013-12-05 12:08:34 +0100 |
commit | e8572cf2f94872d81e7145da31d55c6e1b074247 (patch) | |
tree | 71e189336045cd62ef04ace0a571d8ef7169fa93 /actionpack/test | |
parent | 67998001b60e2bb960d8776266fb7a56fa6be2ba (diff) | |
download | rails-e8572cf2f94872d81e7145da31d55c6e1b074247.tar.gz rails-e8572cf2f94872d81e7145da31d55c6e1b074247.tar.bz2 rails-e8572cf2f94872d81e7145da31d55c6e1b074247.zip |
Add configuration option to optionally disable deep_munge
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/request/query_string_parsing_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request/query_string_parsing_test.rb b/actionpack/test/dispatch/request/query_string_parsing_test.rb index 0ad0dbc958..d82493140f 100644 --- a/actionpack/test/dispatch/request/query_string_parsing_test.rb +++ b/actionpack/test/dispatch/request/query_string_parsing_test.rb @@ -104,6 +104,21 @@ class QueryStringParsingTest < ActionDispatch::IntegrationTest assert_parses({"action" => ['1']}, "action[]=1&action[]") end + test "perform_deep_munge" do + ActionDispatch::Request::Utils.perform_deep_munge = false + begin + assert_parses({"action" => nil}, "action") + assert_parses({"action" => {"foo" => nil}}, "action[foo]") + assert_parses({"action" => {"foo" => {"bar" => nil}}}, "action[foo][bar]") + assert_parses({"action" => {"foo" => {"bar" => [nil]}}}, "action[foo][bar][]") + assert_parses({"action" => {"foo" => [nil]}}, "action[foo][]") + assert_parses({"action" => {"foo" => [{"bar" => nil}]}}, "action[foo][][bar]") + assert_parses({"action" => ['1',nil]}, "action[]=1&action[]") + ensure + ActionDispatch::Request::Utils.perform_deep_munge = true + end + end + test "query string with empty key" do assert_parses( { "action" => "create_customer", "full_name" => "David Heinemeier Hansson" }, |