diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-01-17 20:03:22 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-01-17 20:03:22 -0600 |
commit | aab760c3df4c02377a59a418fc077cdbc07e9fdc (patch) | |
tree | f5ad9649820ecf11bb99e7434be574fc0ca8f46b | |
parent | 78f2c19ae7f9236591c261eecdf0c4b570e3ea1e (diff) | |
download | rails-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.rb | 12 |
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") |