我有一些黄瓜功能,需要与谷歌地图路由API交互。我正在尝试使用VCR来消除这些交互。
我在我的特性中添加了一个VCR标签,如下所示:
@google_routing_api @javascript
Scenario: Creating a bus
Given I am on the buses page
When I follow "Get Started Now"然后在features/support/vcr.rb中添加了我的录像机配置
require 'vcr'
VCR.config do |c|
# INFO: This is relative to the Rails.root
c.cassette_library_dir = 'features/fixtures/vcr_cassettes'
c.stub_with :fakeweb
end
# INFO: https://github.com/myronmarston/vcr/wiki/Usage-with-Cucumber
VCR.cucumber_tags do |t|
t.tag '@google_routing_api'
end但是当我运行我的时钟时,我被告知..
Real HTTP connections are disabled. Unregistered request: GET http://127.0.0.1:54181/__identify__发布于 2011-11-16 15:40:18
您必须将录像机设置为ignore localhost requests。否则,当水豚试图从你的网站请求任何页面时,VCR将阻止它。
将c.ignore_localhost = true添加到您的录像机配置块。
VCR.config do |c|
c.cassette_library_dir = 'features/fixtures/vcr_cassettes'
c.stub_with :fakeweb
c.ignore_localhost = true
endhttps://stackoverflow.com/questions/8148168
复制相似问题