title: Rails, Capybara - capybara cannot find added html elements sometimes
body: <p>I have a function below </p>
  
  <pre><code>  def fill_in_sources_details
      click_button 'New Source'
      assert_text 'Sources'
      fill_in 'text', :with =&gt; @source.text
      fill_in 'url', :with =&gt; @source.url
    end
  </code></pre>
  
  <p>After <code>New Source</code> clicked, new fields added to the page. Sometimes the test fails because the test doesn't wait for new elements to be added so new fields cannot be found be Capybara. I tried to add <code>assert_text 'Sources'</code> which is obvious but it still fails sometimes. Any idea how to fix it?</p>