Permalink
Browse files

Added Test::Unit test to ensure hash_including query matcher works ou…

…tside RSpec environment too
  • Loading branch information...
1 parent b2f1a0c commit 4ad40796663edb47acea7e235a3d55b78b6a57a8 @bblimke committed Feb 5, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 test/shared_test.rb
View
@@ -51,6 +51,13 @@ def test_verification_that_expected_request_occured_with_body_and_headers
:body => "abc", :headers => {'A' => 'a'})
end
+ def test_verification_that_expected_request_occured_with_query_params
+ stub_request(:any, "http://www.example.com").with(:query => hash_including({"a" => ["b", "c"]}))
+ http_request(:get, "http://www.example.com/?a[]=b&a[]=c&x=1")
+ assert_requested(:get, "http://www.example.com",
+ :query => hash_including({"a" => ["b", "c"]}))
+ end
+
def test_verification_that_non_expected_request_didnt_occur
expected_message = %r(The request GET http://www.example.com/ was expected to execute 0 times but it executed 1 time\n\nThe following requests were made:\n\nGET http://www.example.com/ with headers .+ was made 1 time\n\n============================================================)
assert_fail(expected_message) do

0 comments on commit 4ad4079

Please sign in to comment.