title: Capybara - have_css matches empty string when it's supposed not to
body: <p>New at Capybara. Testing the following piece of code. value can be dynamic, including &quot;&quot; (empty).</p>
  <pre class="lang-rb prettyprint-override"><code>within(&quot;#foo&quot;) do
    expect(page).to have_css(&quot;td:nth-child(2)&quot;, text: value)
  end
  </code></pre>
  <p>The problem is: when value = &quot;&quot;, even when there is text in td:nth-child(2) it matches as true.
  Possible reason: the content is rendered async and when Capybara checks for the first time, the text is no yet there (that means, &quot;&quot;), so it is true.</p>
  <p>Any way of only matching true only when the text is indeed empty at the end, and false when it is not empty?</p>