aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-01-17 20:03:22 -0600
committerJoshua Peek <josh@joshpeek.com>2009-01-17 20:03:22 -0600
commitaab760c3df4c02377a59a418fc077cdbc07e9fdc (patch)
treef5ad9649820ecf11bb99e7434be574fc0ca8f46b
parent78f2c19ae7f9236591c261eecdf0c4b570e3ea1e (diff)
downloadrails-aab760c3df4c02377a59a418fc077cdbc07e9fdc.tar.gz
rails-aab760c3df4c02377a59a418fc077cdbc07e9fdc.tar.bz2
rails-aab760c3df4c02377a59a418fc077cdbc07e9fdc.zip
Add test coverage for fixing Safari 2 trailing null character
-rw-r--r--actionpack/test/controller/request/url_encoded_params_parsing_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/request/url_encoded_params_parsing_test.rb b/actionpack/test/controller/request/url_encoded_params_parsing_test.rb
index ee2a239d50..89239687de 100644
--- a/actionpack/test/controller/request/url_encoded_params_parsing_test.rb
+++ b/actionpack/test/controller/request/url_encoded_params_parsing_test.rb
@@ -150,6 +150,18 @@ class UrlEncodedParamsParsingTest < ActionController::IntegrationTest
assert_parses expected, query
end
+ test "parses params with Safari 2 trailing null character" do
+ query = "selected[]=1&selected[]=2&selected[]=3\0"
+ expected = { "selected" => [ "1", "2", "3" ] }
+ assert_parses expected, query
+ end
+
+ test "parses params with Prototype's hack around Safari 2 trailing null character" do
+ query = "selected[]=1&selected[]=2&selected[]=3&_="
+ expected = { "selected" => [ "1", "2", "3" ] }
+ assert_parses expected, query
+ end
+
test "passes through rack middleware and parses params" do
with_muck_middleware do
assert_parses({ "a" => { "b" => "c" } }, "a[b]=c")