Permalink
Browse files

Added more specs to WebMock::Util::URI

  • Loading branch information...
1 parent d9f5f7e commit 7c2155655bca2d60bcf8f625b6102d4e128b5e4f @bblimke committed Feb 11, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 spec/unit/util/uri_spec.rb
View
@@ -168,10 +168,16 @@
end
it "should successfully handle array parameters" do
- uri = 'http://www.example.com:80/path?a[]=b&a[]=c'
- lambda { WebMock::Util::URI.normalize_uri(uri) }.should_not raise_error(ArgumentError)
+ uri_string = 'http://www.example.com:80/path?a[]=b&a[]=c'
+ uri = WebMock::Util::URI.normalize_uri(uri_string)
+ uri.query_values.should == {"a"=>["b", "c"]}
end
+ it "should successfully handle hash parameters" do
+ uri_string = 'http://www.example.com:80/path?a[d]=b&a[e]=c&a[b][c]=1'
+ uri = WebMock::Util::URI.normalize_uri(uri_string)
+ uri.query_values.should == {"a"=>{"d"=>"b", "e"=>"c", "b"=>{"c"=>"1"}}}
+ end
end
describe "stripping default port" do

0 comments on commit 7c21556

Please sign in to comment.