-
-
Save Fire-Dragon-DoL/72b56aae339081e4cc98 to your computer and use it in GitHub Desktop.
Webmock still not working
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
3) DataComApi::Client#search_contact returns instance of SearchContact | |
Failure/Error: HTTParty.get( | |
WebMock::NetConnectNotAllowedError: | |
Real HTTP connections are disabled. Unregistered request: GET https://www.jigsaw.com/rest/searchContact.json?offset=0&pageSize=0 | |
You can stub this request with the following snippet: | |
stub_request(:get, "https://www.jigsaw.com/rest/searchContact.json?offset=0&pageSize=0"). | |
to_return(:status => 200, :body => "", :headers => {}) | |
registered request stubs: | |
stub_request(:get, "https://www.jigsaw.com/rest/searchContact.json with query params hash_including({"offset"=>0, "pageSize"=>0})") | |
============================================================ | |
# ./spec/models/client_spec.rb:65:in `block (3 levels) in <top (r |
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
before do | |
uri = URI.join(client.class.base_uri, DataComApi::ApiURI.search_contact).to_s | |
stub_request( | |
:get, | |
uri | |
).with( | |
query: hash_including({ | |
'pageSize' => 0, | |
'offset' => 0 | |
}) | |
).to_return( | |
body: FactoryGirl.build( | |
:data_com_search_contact_response, | |
totalHits: 0 | |
).to_json | |
) | |
# DEBUG | |
require 'httparty' | |
HTTParty.get( | |
uri, | |
{ | |
query: { | |
offset: 0, | |
pageSize: 0 | |
} | |
} | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment