title: How can I write javascript tests that don't timeout or fail randomly with rspec, capybara, and poltergeist?
body: <p>I have been having problems with my tests timing out and failing randomly. I have been looking around for best practices of how to write robust capybara integration tests but I don't find anything helpful.</p>
  
  <p>Ever since we started writing a bunch of tests our CI server has been failing randomly, making our app look ver unstable, but the tests always (mostly) pass locally.</p>
  
  <p>I want to find out how you and other experienced BDD/TDD gurus handle:</p>
  
  <ul>
  <li>How to deal with external javascript and stuff (KissMetrics, Google Analyics, etc) and</li>
  <li>Debugging and preventing timeout errors that break the build</li>
  </ul>
  
  <p>Any help would be appreciated.</p>