You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using HTTPoison with :hackney, I got the error of response for [URL:#{params[:url]}, METHOD:#{params[:method]}] was not found. The requests are not the same one as recorded in the cassettes so I guess that's the reason it's not working as expected.
So I propose when using ExVCR mockups, we have a switch as bypass. Just like custom, when set to true, it will ignore all the requests that are not specified in the recorded cassettes. Here's an example:
use ExVCR.Mock, adapter: ExVCR.Adapter.Hackney
...hooks and other test cases...
test "it will bypass if the cassette did not match the request" do
use_cassette "no_match", custom: true, bypass: true do
HTTPoison.start
assert HTTPoison.get("http://not_match_cassette.com").status_code == 200
end
end
By combining the custom switch and the bypass switch, we now have the request to be passed directly to the server instead of using a pre-recorded one.
See PR #97 for details. Let me know if you have any question or concern regarding to it. Any discussion is welcome.
The text was updated successfully, but these errors were encountered:
Thanks for the feedback and suggestions. Is it possible to show the actual response from server (or recorded cassette file)?
I'm wondering which part is actually causing the not-found error. It might be one way to add bypass type of option, but not sure enough yet. I think there're some other options to ignore certain part of attributes in the request.
When using
HTTPoison
with :hackney, I got the error ofresponse for [URL:#{params[:url]}, METHOD:#{params[:method]}] was not found
. The requests are not the same one as recorded in the cassettes so I guess that's the reason it's not working as expected.So I propose when using ExVCR mockups, we have a switch as
bypass
. Just likecustom
, when set to true, it will ignore all the requests that are not specified in the recorded cassettes. Here's an example:By combining the
custom
switch and thebypass
switch, we now have the request to be passed directly to the server instead of using a pre-recorded one.See PR #97 for details. Let me know if you have any question or concern regarding to it. Any discussion is welcome.
The text was updated successfully, but these errors were encountered: