Webmock test fails on CircleCi only

I have a WebMock spec that is failing on circleci only. Does anyone know what could be causing this?

Failure/Error: expect(WebMock).to have_requested(:post, "http://api.prerender.io/recache").twice
   The request POST http://api.prerender.io/recache was expected to execute 2 times but it executed 0 times

In spec_helper.rb we have:

 WebMock.disable_net_connect!(allow_localhost: true)

same problem here, could you fix it?

@JannikS Yes I fixed it. The issue I had was that PRERENDER API token was not included in circleci settings, so the WebMock call was failing.

If you ssh to the machine and run the test via debugger, you will be able to find the root cause.