aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/cgi_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-01-12 09:10:58 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-01-12 09:10:58 +0000
commit41198ad3ad1925b2b88df9b16638c36dee43500f (patch)
treea9afcc4da1cc81e24add5a713556cb89a3f6f58a /actionpack/test/controller/cgi_test.rb
parentc62e5e1a3a60c2360ae5a356bf7697dd4417ecb6 (diff)
downloadrails-41198ad3ad1925b2b88df9b16638c36dee43500f.tar.gz
rails-41198ad3ad1925b2b88df9b16638c36dee43500f.tar.bz2
rails-41198ad3ad1925b2b88df9b16638c36dee43500f.zip
Fix parsing of array[] CGI parameters so extra empty values aren't included. Closes #6252.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5904 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/cgi_test.rb')
-rwxr-xr-xactionpack/test/controller/cgi_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb
index 1d2888ad89..e7d44802a5 100755
--- a/actionpack/test/controller/cgi_test.rb
+++ b/actionpack/test/controller/cgi_test.rb
@@ -425,4 +425,16 @@ class CGIRequestTest < Test::Unit::TestCase
assert_equal ["c84ace84796670c052c6ceb2451fb0f2"], alt_cookies["_session_id"]
assert_equal ["yes"], alt_cookies["is_admin"]
end
+
+ def test_unbalanced_query_string_with_array
+ assert_equal(
+ {'location' => ["1", "2"], 'age_group' => ["2"]},
+ CGIMethods.parse_query_parameters("location[]=1&location[]=2&age_group[]=2")
+ )
+ assert_equal(
+ {'location' => ["1", "2"], 'age_group' => ["2"]},
+ CGIMethods.parse_request_parameters({'location[]' => ["1", "2"],
+ 'age_group[]' => ["2"]})
+ )
+ end
end