diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-08-04 00:15:09 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-08-04 00:15:09 +0000 |
commit | 6e842f216c52d23f33a19a18cff7db14fe3787fc (patch) | |
tree | c4a99e8eeaedb90a3d7642b2cda4dc3af5dd4855 /actionpack/test/controller | |
parent | 08f40a5e061d51b0cb909bb1160ac03a3b47c232 (diff) | |
download | rails-6e842f216c52d23f33a19a18cff7db14fe3787fc.tar.gz rails-6e842f216c52d23f33a19a18cff7db14fe3787fc.tar.bz2 rails-6e842f216c52d23f33a19a18cff7db14fe3787fc.zip |
Make us pass to ease RESTful children posts
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4658 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rwxr-xr-x | actionpack/test/controller/cgi_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb index f0af5b4ed3..9e5aa9f92f 100755 --- a/actionpack/test/controller/cgi_test.rb +++ b/actionpack/test/controller/cgi_test.rb @@ -34,6 +34,17 @@ class CGITest < Test::Unit::TestCase 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( |