Capybara tests only failing on circle



I have a feature test that relies on a presenter object. I’ve build a method that populates the database so that the presenter has things to return, and locally, the db is populated and Capybara is able to load the page with the information it needs. Tests all pass beautifully.

Circle hates this.

I’ve SSH’d in and discovered that the reason the specs fail on Circle is because the controller is setting the instance variable it needs to create the page to nil, although all the information is in the test DB. I’ve tried stubbing this in all sorts of ways, and nothing I seem to do gets capybara on circle to be able to access the information sitting in the database.

I thought this might have something to do with containers, but even when I run the test in a single container I get the same error. Any suggestions as to HOW I can stub this instance variable on circle?


Hi Jean,
I’ve had a number of issues with cucumber both locally and couple on circle due to database cleaning and some custom setup I did.

We’ve decided to move all cucumber specs to RSpec/Capybara to get rid of any further issues with Cucumber.


Btw I also encountered an issue where the record was not in the server’s database (but that doesn’t have anything to do with circle), the problem was I was using transactional database cleaning.

Another issue I run into often is timing - most of the time the AJAX request is fast on my machine, but slow to finish on circle and the result is a failure in some cases.


@hakunin do you know why transactional tests aren’t working on Circle? I’m investigating how to use transactions locally and truncation on CI but even better if I can run transactions on Circle.