I have a test that looks like this.
RSpec.describe 'Modify visit summary letters', type: :system do
scenario 'with one correspondence relationship' do
VCR.use_cassette 'correspondence/faxes/valid_number' do
# test steps omitted for brevity
end
end
end
This test normally passes just fine. But when I change a certain form from remote: false
to remote: true
(to be clear, I'm changing this and nothing else) the test stops working.
When I run my test after the remote: true
change I get:
VCR::Errors::UnhandledHTTPRequestError:
================================================================================
An HTTP request has been made that VCR does not know how to handle:
POST https://rest.interfax.net/outbound/faxes?faxNumber=%2B15555555555
There is currently no cassette in use.
It says there's no cassette in use even though, obviously, there is.
Why might this be happening and what can I do to fix it?
Edit: Here's my VCR config.
VCR.configure do |c|
c.cassette_library_dir = 'spec/cassettes'
c.hook_into :webmock
c.ignore_localhost = true
c.ignore_hosts 'chromedriver.storage.googleapis.com'
c.default_cassette_options = {
match_requests_on: [
:method,
VCR.request_matchers.uri_without_param('faxNumber')
]
}
end