5
我有一些需要與Google Maps Routing API交互的Cucumber功能。我正在嘗試使用VCR來刪除這些交互。通過標籤對黃瓜使用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
加入我的VCR的配置,但是當我運行我cukes,有人告訴我..
Real HTTP connections are disabled. Unregistered request: GET http://127.0.0.1:54181/__identify__
FWIW,問題(和解決方案)與黃瓜無關。它與水豚有關,它可以啓動你的應用程序,並在使用JavaScript驅動程序時向它發出請求。如果您使用Test :: Unit或RSpec使用水豚,您會遇到同樣的問題。 –