When I put a cassette tag on a Cucumber featured tagged with @javascript (causing Capybara to use the Selenium driver), strange things start happening...
The first time I run it, everything happens as expected: the cassette records, the data is used, and everything passes.
The next time I run it (off the cassette), it fails with Unregistered request: GET http://localhost:9887/identify.
It seems that Selenium needs to talk to its server using that port (pinging it to see if it exists, in this instance). I'm not precisely just sure how VCR is messing that up, but it is.
It would probably be useful to allow localhost requests through (either configurable or by an @allow_localhost tag, or both).
This should be resolved by 2ed9c3c318305ee39fa054997da1b67c1413a408.
I'm having the same problem on version 1.11.3, with rspec requests test with :js => true (capybara, selenium).
GET http://localhost:9887/__identify__
.I got over this by setting c.allow_http_connections_when_no_cassette = true
in some situations.
@clyfe -- I recommend you use the c.ignore_localhost = true
config option instead; it's specifically intended for this.
@myronmarston Thanks for c.ignore_localhost = true
, it helped me. But I wanted to record a local service. So first I recorded it and then changed host in the cassette.
Most helpful comment
@clyfe -- I recommend you use the
c.ignore_localhost = true
config option instead; it's specifically intended for this.