Permalink
Browse files

Make us pass to ease RESTful children posts

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4658 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 08f40a5 commit 6e842f216c52d23f33a19a18cff7db14fe3787fc @dhh dhh committed Aug 4, 2006
Showing with 11 additions and 0 deletions.
  1. +11 −0 actionpack/test/controller/cgi_test.rb
@@ -34,6 +34,17 @@ def test_deep_query_string_with_array
assert_equal({'x' => {'y' => {'z' => ['10']}}}, CGIMethods.parse_query_parameters('x[y][z][]=10'))
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_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
+
+ def test_deep_query_string_with_array_of_hashes_with_multiple_pairs
+ assert_equal(
+ {'x' => {'y' => [{'z' => '10', 'w' => 'a'}, {'z' => '20', 'w' => 'b'}]}},
+ CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][w]=a&x[y][][z]=20&x[y][][w]=c')
+ )
+ end
def test_query_string_with_nil
assert_equal(

0 comments on commit 6e842f2

Please sign in to comment.