Hi,
I have a rails app with Webmock and VCR. I'd like to have Webmock intercept a call to return a 401 and then allow VCR to handle the next call with the real response. I'd like to have the following code work:
stub_request(:any, %r|.*/rest/user.*|).to_return(:body => '{"errorCode": "SESSION_EXPIRED", "errorMessage": "session has expired"}',
:status => [401, 'Unauthorized'],
:headers => { 'error' => 'SESSION_EXPIRED'}).then
.remove
Webmock is handling the call - and I could do the to_return with the new response, but it would be simpler if I could just remove the stub and then VCR would automatically handle the next request.
Thanks,
Chris