aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2005-09-27 22:23:37 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2005-09-27 22:23:37 +0000
commit17d2732b1cc50fd97685417080beb72d00609daf (patch)
tree5a80084bc3e543209fb489ed30871794926df7e3 /actionpack/test/controller
parent0c23f06129ac492896e0f5461bcf3a041c06f2c4 (diff)
downloadrails-17d2732b1cc50fd97685417080beb72d00609daf.tar.gz
rails-17d2732b1cc50fd97685417080beb72d00609daf.tar.bz2
rails-17d2732b1cc50fd97685417080beb72d00609daf.zip
Ticket #2295 - Tolerate consecutive delimiters in query parameters
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2375 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rwxr-xr-xactionpack/test/controller/cgi_test.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb
index a896128168..b70b1628a6 100755
--- a/actionpack/test/controller/cgi_test.rb
+++ b/actionpack/test/controller/cgi_test.rb
@@ -14,6 +14,8 @@ class CGITest < Test::Unit::TestCase
"action=update_order&full_name=Lau%20Taarnskov&products=4&products=2&products=3"
@query_string_with_many_equal = "action=create_customer&full_name=abc=def=ghi"
@query_string_without_equal = "action"
+ @query_string_with_many_ampersands =
+ "&action=create_customer&&&full_name=David%20Heinemeier%20Hansson"
end
def test_query_string
@@ -66,7 +68,14 @@ class CGITest < Test::Unit::TestCase
CGIMethods.parse_query_parameters(@query_string_without_equal)
)
end
-
+
+ def test_query_string_with_many_ampersands
+ assert_equal(
+ { "action" => "create_customer", "full_name" => "David Heinemeier Hansson"},
+ CGIMethods.parse_query_parameters(@query_string_with_many_ampersands)
+ )
+ end
+
def test_parse_params
input = {
"customers[boston][first][name]" => [ "David" ],