title: How to make Capybara check for visibility after some JS has run?
body: <p>After loading a page I have code that runs and hides and shows various items based on data returned by an xhr.</p>
  
  <p>My integration test looks something like this:</p>
  
  <pre><code>it "should not show the blah" do
      page.find('#blah').visible?.should be_true
  end 
  </code></pre>
  
  <p>When I manually go to the page in the context this test runs, #blah is <em>not</em> visible as I expect. I suspect that Capybara is looking at the initial state of the page (invisible in this case), evaluating the state of the DOM and failing the test before the JS runs. </p>
  
  <p>Yes, I set the <code>:js =&gt; true</code> on the containing describe block :)</p>
  
  <p>Any ideas would be greatly appreciated! I'm hoping I don't have to put an intentional delay in here, that feels flaky and will slow things down.</p>