-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converts to string for comparing w/ hash_including
This change updates so the expected request and actual request, are compared to as strings, when using hash_including
- Loading branch information
1 parent
0678821
commit 9fb40fc
Showing
4 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require "spec_helper" | ||
begin | ||
require "httparty" | ||
rescue LoadError | ||
@skip_specs = true | ||
end | ||
|
||
unless @skip_specs | ||
RSpec.describe "Hash including Bug" do | ||
let!(:dummy_url) { 'http://dummyurl.com' } | ||
|
||
it "receive a request" do | ||
stub_request(:get, dummy_url). | ||
with(:query => hash_including({ param1: 5 })). | ||
to_return(:body => 'body 1') | ||
|
||
expect( | ||
HTTParty.get(dummy_url, { | ||
query: { | ||
:param1 => 5, | ||
:param2 => 'random1' | ||
} | ||
}).body | ||
).to eq 'body 1' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters