Created
May 16, 2015 13:42
-
-
Save detomastah/7c7c8e340e4ec69abf90 to your computer and use it in GitHub Desktop.
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
Failure/Error: post :notification, { "communication_id" => "666", "content" => {"id_sale" => 123} } | |
WebMock::NetConnectNotAllowedError: | |
Real HTTP connections are disabled. Unregistered request: POST https://direct.paylane.com/rest/sales/info with body '{"id_sale":"123"}' with headers {'Authorization'=>'Basic ZGV0b21hc3RhaDpodTJzd2U0ag==', 'Connection'=>'close', 'Content-Type'=>'application/json', 'Host'=>'direct.paylane.com', 'User-Agent'=>'RubyHTTPGem/0.8.4'} | |
You can stub this request with the following snippet: | |
stub_request(:post, "https://direct.paylane.com/rest/sales/info"). | |
with(:body => "{\"id_sale\":\"123\"}", | |
:headers => {'Authorization'=>'Basic ZGV0b21hc3RhaDpodTJzd2U0ag==', 'Connection'=>'close', 'Content-Type'=>'application/json', 'Host'=>'direct.paylane.com', 'User-Agent'=>'RubyHTTPGem/0.8.4'}). | |
to_return(:status => 200, :body => "", :headers => {}) | |
registered request stubs: | |
stub_request(:post, "https://direct.paylane.com/rest/sales/info"). | |
with(:body => "{\"id_sale\":\"123\"}", | |
:headers => {'Authorization'=>'Basic emx5Omh1MnN3ZTRq', 'Connection'=>'close', 'Content-Type'=>'application/json', 'Host'=>'direct.paylane.com', 'User-Agent'=>'RubyHTTPGem/0.8.4'}) | |
============================================================ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment