Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added more specs to WebMock::Util::URI
  • Loading branch information
bblimke committed Feb 11, 2012
1 parent d9f5f7e commit 7c21556
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spec/unit/util/uri_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit 7c21556

Please sign in to comment.