Permalink
Browse files

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
  • Loading branch information...
dhh committed Aug 26, 2006
1 parent bcbce90 commit 9e054fdf417078763e80ba975dde5672017ebf9f
Showing with 6 additions and 0 deletions.
  1. +6 −0 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

0 comments on commit 9e054fd

Please sign in to comment.