如何解决切换到远程形式:真正中断VCR
我有一个看起来像这样的测试。
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
此测试通常可以通过。但是,当我将某种形式从remote: false
更改为remote: true
(很明显,我正在更改此内容,没有其他更改)时,测试将停止工作。
在remote: true
更改之后运行测试时,我得到:
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.
它说虽然显然有没有使用盒式磁带。
为什么会发生这种情况,我该怎么解决?
编辑:这是我的VCR配置。
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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。