That generally shouldn't matter, although I can think of an obscure
situation you could get yourself into if you configured VCR a
particular way and you had originally recorded the cassette when the
code-under-test made only 1 request. You can delete the cassette and
re-run the test; if you were in this situation it would record both
requests this time.
It's hard for me to guess what the problem might be, but two other
ideas that come to mind...
* If the authorization request is made using a different HTTP client
and VCR hasn't been configured to hook into that client, then it would
make sense that it wouldn't record or playback that request.
* In the test it looks like you're using capybara. Are you using the
rack-test drivers or one of the javascript drivers? I ask because the
rack-test driver is synchronous but the rest of the drivers (at least
the ones I've tried) are not. Your app runs in a separate thread, and
"action" methods like `click_link` or `click_button` do not wait for a
response from the app before returning. So...you can get in
situations where in your test a cassette is wrapping a call to
`click_link`, which should trigger a code path in your application
that makes an HTTP request, but the cassette may be ejected before the
request is made since it's asynchronous.
If you can come up with a reproducible example I can take a look at
it. You may also want to try the debug_logger[1] option--it will
likely give you some insight into what's going on.
HTH,
Myron
[1]
https://www.relishapp.com/myronmarston/vcr/v/2-1-0/docs/configuration/debug-logging