Search code examples
ruby-on-railsrspeccapybara

What is the `__identify__` route that Capybara looks for?


When I disable Webmock or VCR I get the following error in my Rspec tests. Apparently it's looking for an /__identify__ route.

          WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://127.0.0.1:51768/__identify__ with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>'Ruby'}

A bit of googling shows that this is something specific to Capybara, but I wasn't able to find out what exactly it's trying to do and why it might need to be stubbed.

Thanks!


Solution

  • You shouldn't be stubbing it - you should be allowing it (like all requests to your app). Its a route added via middleware Capybara installs when it starts up the "server" thread running your app. Capybara needs it to know the app has started up and is ready to go.