From a895be0259eb2e47fab8de3c8d30c700a304d441 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 16 Jun 2005 06:42:49 +0000 Subject: Fixed query parser to deal gracefully with equal signs inside keys and values #1345 [gorou] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1441 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/cgi_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'actionpack/test/controller/cgi_test.rb') diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb index f0058d2bf8..1749eb0c80 100755 --- a/actionpack/test/controller/cgi_test.rb +++ b/actionpack/test/controller/cgi_test.rb @@ -21,6 +21,8 @@ class CGITest < Test::Unit::TestCase @query_string_with_amps = "action=create_customer&name=Don%27t+%26+Does" @query_string_with_multiple_of_same_name = "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" end def test_query_string @@ -51,6 +53,20 @@ class CGITest < Test::Unit::TestCase ) end + def test_query_string_with_many_equal + assert_equal( + { "action" => "create_customer", "full_name" => "abc=def=ghi"}, + CGIMethods.parse_query_parameters(@query_string_with_many_equal) + ) + end + + def test_query_string_without_equal + assert_equal( + { "action" => nil }, + CGIMethods.parse_query_parameters(@query_string_without_equal) + ) + end + def test_parse_params input = { "customers[boston][first][name]" => [ "David" ], -- cgit v1.2.3