aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/cgi_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-08-28 14:05:05 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-08-28 14:05:05 +0000
commitd164d09649c45bc9478e6ac52787e648a14317cc (patch)
tree4a0a922dd5271792867cffe30cb07fdd7aa827c4 /actionpack/test/controller/cgi_test.rb
parent8261f17eb86c85e6e747b6da0f7aeb19b3a8a905 (diff)
downloadrails-d164d09649c45bc9478e6ac52787e648a14317cc.tar.gz
rails-d164d09649c45bc9478e6ac52787e648a14317cc.tar.bz2
rails-d164d09649c45bc9478e6ac52787e648a14317cc.zip
FormEncodedStringParser needs a tad more work before it can handle POST data (like file handling), so were backing out for a bit
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4833 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/cgi_test.rb')
-rwxr-xr-xactionpack/test/controller/cgi_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb
index d235379e3d..256fd7e58f 100755
--- a/actionpack/test/controller/cgi_test.rb
+++ b/actionpack/test/controller/cgi_test.rb
@@ -17,6 +17,11 @@ class CGITest < Test::Unit::TestCase
@query_string_without_equal = "action"
@query_string_with_many_ampersands =
"&action=create_customer&&&full_name=David%20Heinemeier%20Hansson"
+ @query_string_with_escaped_brackets = "subscriber%5Bfirst_name%5D=Jan5&subscriber%5B\
+last_name%5D=Waterman&subscriber%5Bemail%5D=drakn%40domain.tld&subscriber%5Bpassword\
+%5D=893ea&subscriber%5Bstreet%5D=&subscriber%5Bzip%5D=&subscriber%5Bcity%5D\
+=&commit=Update+info"
+
end
def test_query_string
@@ -29,6 +34,15 @@ class CGITest < Test::Unit::TestCase
def test_deep_query_string
expected = {'x' => {'y' => {'z' => '10'}}}
assert_equal(expected, CGIMethods.parse_query_parameters('x[y][z]=10'))
+ expected = {"commit"=>"Update info",
+ "subscriber" => {
+ "city" => nil, "zip"=>nil,
+ "last_name" => "Waterman", "street" => nil,
+ "password" =>"893ea", "first_name" => "Jan5" ,
+ "email" => "drakn@domain.tld"
+ }
+ }
+ assert_equal(expected, CGIMethods.parse_query_parameters(@query_string_with_escaped_brackets))
end
def test_deep_query_string_with_array