From 04fda65306e5779d89a93ec3e9e7cf8541ead144 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 26 Aug 2006 02:49:09 +0000 Subject: Changed the POST parameter processing to use the new QueryStringParser and make the result a indifferent hash [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4821 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/cgi_test.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb index 174fe96952..be0ed1feef 100755 --- a/actionpack/test/controller/cgi_test.rb +++ b/actionpack/test/controller/cgi_test.rb @@ -27,7 +27,9 @@ class CGITest < Test::Unit::TestCase end def test_deep_query_string - assert_equal({'x' => {'y' => {'z' => '10'}}}, CGIMethods.parse_query_parameters('x[y][z]=10')) + expected = {'x' => {'y' => {'z' => '10'}}} + assert_equal(expected, CGIMethods.parse_query_parameters('x[y][z]=10')) + assert_equal("10", CGIMethods.parse_query_parameters('x[y][z]=10')[:x][:y][:z]) end def test_deep_query_string_with_array @@ -38,7 +40,6 @@ class CGITest < Test::Unit::TestCase 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 -- cgit v1.2.3