aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/cgi_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-08-26 01:57:44 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-08-26 01:57:44 +0000
commit9e054fdf417078763e80ba975dde5672017ebf9f (patch)
tree90bb7858e0774c3d534e750a587d93c8c8f14bf8 /actionpack/test/controller/cgi_test.rb
parentbcbce90b1b0a6a9a50bd8236d968d88ae6977af7 (diff)
downloadrails-9e054fdf417078763e80ba975dde5672017ebf9f.tar.gz
rails-9e054fdf417078763e80ba975dde5672017ebf9f.tar.bz2
rails-9e054fdf417078763e80ba975dde5672017ebf9f.zip
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
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