title: RSpec Capybara locator not finding link text
body: <p>I have a page with a simple <code>&lt;a&gt;</code> tag with the text <code>Upload Video</code>. I set a break point in my rspec test and do this:</p>
  
  <pre><code>Capybara.current_session.find('.primary')
  #&lt;Capybara::Node::Element tag="a" path="/html/body/div[3]/div[1]/div[2]/div/div[1]/div[4]/label/a"&gt;
  
  Capybara.current_session.find('.primary').text
  "Upload Video"
  
  Capybara.current_session.find('.primary').visible?
  true
  </code></pre>
  
  <p>So we know for sure there is a link with <code>Upload Video</code> text on the page.</p>
  
  <p>But when I do</p>
  
  <pre><code>Capybara.current_session.has_link?('Upload Video')
  false
  </code></pre>
  
  <p>I get <code>false</code>. From the <a href="https://github.com/teamcapybara/capybara/blob/63a12e7ba064fe326b36d014ede8c9269855a6af/lib/capybara/node/matchers.rb#L262" rel="nofollow noreferrer">docs</a> it seems the <code>locator</code> can be element text. So why isn't this working?</p>
  
  <p>This alternative seems to work:</p>
  
  <pre><code>Capybara.current_session.has_selector?(:css, 'a.primary', text: 'Upload Video')
  </code></pre>