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
{{#tags}}- {{label}}
{{/tags}}