aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/cgi_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/cgi_test.rb')
-rwxr-xr-xactionpack/test/controller/cgi_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb
index 45d4cf686c..174fe96952 100755
--- a/actionpack/test/controller/cgi_test.rb
+++ b/actionpack/test/controller/cgi_test.rb
@@ -35,6 +35,12 @@ class CGITest < Test::Unit::TestCase
assert_equal({'x' => {'y' => {'z' => ['10', '5']}}}, CGIMethods.parse_query_parameters('x[y][z][]=10&x[y][z][]=5'))
end
+ def test_deep_query_string_with_array_of_hash
+ assert_equal({'x' => {'y' => [{'z' => '10'}]}}, CGIMethods.parse_query_parameters('x[y][][z]=10'))
+ assert_equal({'x' => {'y' => [{'z' => '10', 'w' => '10'}]}}, CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][w]=10'))
+ assert_equal({'x' => [{'y' => {'z' => '10', 'w' => '10'}}]}, CGIMethods.parse_query_parameters('x[][y][z]=10&x[][y][w]=10'))
+ end
+
def test_deep_query_string_with_array_of_hashes_with_one_pair
assert_equal({'x' => {'y' => [{'z' => '10'}, {'z' => '20'}]}}, CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][z]=20'))
end