Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #161 from timcraft/master

Spec that CGI.parse can handle semicolons in place of ampersands
  • Loading branch information...
commit ea047c8f9a0a83123c00c8496680e67598b7c5ea 2 parents c39d507 + b4be172
@dbussink dbussink authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 library/cgi/parse_spec.rb
View
5 library/cgi/parse_spec.rb
@@ -8,6 +8,11 @@
CGI.parse("test=a&a=&b=").should == { "test" => ["a"], "a" => [""], "b" => [""] }
end
+ it "parses query strings with semicolons in place of ampersands" do
+ CGI.parse("test=test;a=b").should == { "a" => ["b"], "test" => ["test"] }
+ CGI.parse("test=a;a=;b=").should == { "test" => ["a"], "a" => [""], "b" => [""] }
+ end
+
it "allows passing multiple values for one key" do
CGI.parse("test=1&test=2&test=3").should == { "test" => ["1", "2", "3"] }
CGI.parse("test[]=1&test[]=2&test[]=3").should == { "test[]" => [ "1", "2", "3" ] }
Please sign in to comment.
Something went wrong with that request. Please try again.