Browse files

Add test coverage for fixing Safari 2 trailing null character

  • Loading branch information...
1 parent 78f2c19 commit aab760c3df4c02377a59a418fc077cdbc07e9fdc @josh josh committed Jan 17, 2009
Showing with 12 additions and 0 deletions.
  1. +12 −0 actionpack/test/controller/request/url_encoded_params_parsing_test.rb
View
12 actionpack/test/controller/request/url_encoded_params_parsing_test.rb
@@ -150,6 +150,18 @@ def teardown
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")

0 comments on commit aab760c

Please sign in to comment.