title: How to get poltergeist/PhantomJS to delay returning the page to Capybara until AJAX is loaded?
body: <p>How do I keep PhantomJS from returning the page to Capybara for several seconds to allow AJAX to finish loading?  The HTML body I am getting back is:</p>
  
  <pre><code>&lt;!--div class='loading'&gt;PLEASE WAIT WHILE PAGE LOADS&lt;/div--&gt;
  </code></pre>
  
  <p>Which is telling me that PhantomJS returned the page before the page finished loading its AJAX assets.  Is there any way I can slow this down? I've tried using the rasterize.js solution but it looks as though any script I add to poltergeist's "phantomjs_options" hash is overlooked.</p>