From 9e054fdf417078763e80ba975dde5672017ebf9f Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 26 Aug 2006 01:57:44 +0000 Subject: [PATCH] More tests for array/hashing in parameters, one failing git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4820 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/cgi_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) 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 @@ 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 -- GitLab