Skip to content
Browse files

Updated README with info about setting expectations on query params o…

…r body with hash
  • Loading branch information...
1 parent d2d33cc commit fa4ab291680f693d4e788c648471f1401829919e Bartosz Blimke committed Jun 19, 2010
Showing with 10 additions and 0 deletions.
  1. +10 −0 README.md
View
10 README.md
@@ -315,6 +315,11 @@ You can also use WebMock without RSpec or Test::Unit support:
WebMock.should_not have_requested(:get, "www.something.com")
WebMock.should have_requested(:post, "www.example.com").with { |req| req.body == "abc" }
+
+ WebMock.should have_requested(:get, "www.example.com").with(:query => {"a" => ["b", "c"]})
+
+ WebMock.should have_requested(:get, "www.example.com").
+ with(:body => {"a" => ["b", "c"]}, :headers => 'Content-Type' => 'application/json')
### Different way of setting expectations in RSpec
@@ -326,6 +331,11 @@ You can also use WebMock without RSpec or Test::Unit support:
request(:post, "www.example.com").with { |req| req.body == "abc" }.should have_been_made
+ request(:get, "www.example.com").with(:query => {"a" => ["b", "c"]}).should have_been_made
+
+ request(:post, "www.example.com").
+ with(:body => {"a" => ["b", "c"]}, :headers => 'Content-Type' => 'application/json').should have_been_made
+
## Clearing stubs and request history
If you want to reset all current stubs and history of requests use `WebMock.reset_webmock`

0 comments on commit fa4ab29

Please sign in to comment.
Something went wrong with that request. Please try again.