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
上级 bcbce90b
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册