Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4820

Show
Ignore:
Timestamp:
08/26/06 01:57:44 (2 years ago)
Author:
david
Message:

More tests for array/hashing in parameters, one failing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/test/controller/cgi_test.rb

    r4659 r4820  
    3434    assert_equal({'x' => {'y' => {'z' => ['10']}}}, CGIMethods.parse_query_parameters('x[y][z][]=10')) 
    3535    assert_equal({'x' => {'y' => {'z' => ['10', '5']}}}, CGIMethods.parse_query_parameters('x[y][z][]=10&x[y][z][]=5')) 
     36  end 
     37 
     38  def test_deep_query_string_with_array_of_hash 
     39    assert_equal({'x' => {'y' => [{'z' => '10'}]}}, CGIMethods.parse_query_parameters('x[y][][z]=10')) 
     40    assert_equal({'x' => {'y' => [{'z' => '10', 'w' => '10'}]}}, CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][w]=10')) 
     41    assert_equal({'x' => [{'y' => {'z' => '10', 'w' => '10'}}]}, CGIMethods.parse_query_parameters('x[][y][z]=10&x[][y][w]=10')) 
    3642  end 
    3743