diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-04 19:21:48 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-04 19:21:48 +0000 |
commit | 128e35261401a93a4b280ca32d2d4d9040b2f4a7 (patch) | |
tree | df885d4bb8a427985c8faeb4db5cfddba5d066eb /actionpack/test | |
parent | 9e4f5f33974b018fe4b6eba2766af263f8b06951 (diff) | |
download | rails-128e35261401a93a4b280ca32d2d4d9040b2f4a7.tar.gz rails-128e35261401a93a4b280ca32d2d4d9040b2f4a7.tar.bz2 rails-128e35261401a93a4b280ca32d2d4d9040b2f4a7.zip |
Fixed that hashes was not working properly when passed by GET to lighttpd #849 [Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1677 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rwxr-xr-x | actionpack/test/controller/cgi_test.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb index 1e4bb16337..74f4fc9e8b 100755 --- a/actionpack/test/controller/cgi_test.rb +++ b/actionpack/test/controller/cgi_test.rb @@ -32,7 +32,16 @@ class CGITest < Test::Unit::TestCase CGIMethods.parse_query_parameters(@query_string) ) end - + + def test_deep_query_string + assert_equal({'x' => {'y' => {'z' => '10'}}}, CGIMethods.parse_query_parameters('x[y][z]=10')) + end + + 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_query_string_with_nil assert_equal( { "action" => "create_customer", "full_name" => nil}, @@ -41,10 +50,10 @@ class CGITest < Test::Unit::TestCase end def test_query_string_with_array - assert_equal( + assert_equal( { "action" => "create_customer", "selected" => ["1", "2", "3"]}, CGIMethods.parse_query_parameters(@query_string_with_array) - ) + ) end def test_query_string_with_amps |