exvcr icon indicating copy to clipboard operation
exvcr copied to clipboard

ExVCR is trying to match request even though i'm not using use_cassete

Open sescobb27 opened this issue 6 years ago • 8 comments

Hi there, i'm trying to do some integration testing hitting a real 3rd party service (Stripe) and not a cassette, so i'm not using use_cassette or anything like that but still getting a RequestNotMatchError with a "previous" cassette (oembed-youtube). is there a way to disable ExVCR or to let it know i'm not asking to record a new cassette? (it works if i just run mix test PATH/TO/TEST.exs) but not when running mix test

** (ExVCR.RequestNotMatchError) Request did not match with any one in the current cassette: test/fixtures/vcr_cassettes/oembed-youtube.json.
     Delete the current cassette with [mix vcr.delete] and re-record.

sescobb27 avatar Apr 20 '18 21:04 sescobb27

I ran into a similar problem and found that if I configured ExVCR to "clear mocks" then the mocking behaviour would be cleared between tests.

use ExVCR.Mock, adapter: ExVCR.Adapter.Hackney, clear_mock: true

dwhelan avatar May 09 '18 17:05 dwhelan

@dwhelan oh, thanks, i will try that.

sescobb27 avatar May 09 '18 17:05 sescobb27

unfortunately, that didn't work 😞 i'm still getting (ExVCR.RequestNotMatchError) from previous cassette

** (ExVCR.RequestNotMatchError) Request did not match with any one in the current cassette: test/fixtures/vcr_cassettes/oembed-youtube.json.
     Delete the current cassette with [mix vcr.delete] and re-record.

sescobb27 avatar May 09 '18 18:05 sescobb27

This didn't work for me either. For reference, I've got an umbrella application, but all my errors seem to be happening within the same umbrella application.

SkipMike avatar Oct 08 '18 19:10 SkipMike

I'm also using exvcr 0.10.0.

SkipMike avatar Oct 08 '18 20:10 SkipMike

I've updated to 0.10.3 and still seeing the same problems.

SkipMike avatar Oct 08 '18 20:10 SkipMike

I'm experiencing the same issue after adding SendGrid to tests that do not use ExVCR. When running a single test file by itself the problem does not occur. Adding clear_mock did not work.

a-kinder avatar Nov 21 '18 16:11 a-kinder

For posterity: syntax should be options: [clear_mock: true]. This worked for me

a-kinder avatar Nov 21 '18 16:11 a-kinder