diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb index 45d4cf686c25e0f3d47663de9594789e89aebb58..174fe96952bf60e92de8356bc0d571f551c02d63 100755 --- a/actionpack/test/controller/cgi_test.rb +++ b/actionpack/test/controller/cgi_test.rb @@ -35,6 +35,12 @@ def test_deep_query_string_with_array 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