We have a race condition between click_link and reload_page. Sometimes the AJAX call will go through before Capybara reloads the page, and sometimes it won’t. This kind of nondeterministic test can be very difficult to debug, so I added a little helper. Capybara’s Little Helper Here’s the helper, via Coderwall: # spec/support/wait_for_ajax.rb module WaitForAjax def wait_for_ajax Timeout.timeout(Ca