Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExVCR.RequestNotMatchError - Ignore / bypass the request not matching recorded cassette #101

Open
manjufy opened this issue Apr 26, 2017 · 1 comment

Comments

@manjufy
Copy link

manjufy commented Apr 26, 2017

This happens when we have multiple requests in the test suite

  ** (EXIT from #PID<0.3049.0>) an exception was raised:
         ** (ExVCR.RequestNotMatchError) Request did not match with any one in the current cassette: test/fixture/vcr_cassettes/response.json.
     Delete the current cassette with [mix vcr.delete] and re-record.

     Request: [:get, "https://example.com", [], "", []]

Its clear from the above exception that, there are two requests. My test suite suppose to catch the second request and match the cassette response.

Would it be possible to do following

Ignore the request response if it does not match the cassette name use_cassette "contentful-cache"

In my case, its clear that the first response would not match the my cassette response at all.... in this case, if I could do bypass the request until I find the request that matches my recorded response then we would not have inconsistent behaviour with cassettes..

I have seen multiple issues raised here

#96
#81
#53

When we run the tests independently, they work fine.
Ex: mix test test/model_test.exs

However, when we run the entire test suite
Ex: mix test

we would have this issue with multiple requests not matching the cassettes.

@manjufy manjufy changed the title ExVCR.RequestNotMatchError - ExVCR.RequestNotMatchError - Ignore / bypass the request not matching recorded cassette Apr 26, 2017
@parroty
Copy link
Owner

parroty commented May 1, 2017

Thanks for the comment. Having the bypass option suggested for #96 satisfies your expectation?

I couldn't clearly understand this part. Some more description or example helps too.

Would it be possible to do following
Ignore the request response if it does not match the cassette name use_cassette "contentful-cache"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants