title: Testing a link's target attribute with Capybara/RSpec
body: <p>I'm a bit new to Rails/RSpec/Capybara, so this is probably a newbie question, but Google didn't help as much as I would have hoped. I was hoping that I could use</p>
  
  <pre><code>it { should have_link('link text', href: 'url', target: '_blank') }
  </code></pre>
  
  <p>to write a test for a link that should open in a new window, but that doesn't seem to work.  I've also tried wrapping the options hash in curly-braces:</p>
  
  <pre><code>it { should have_link('link text', {href: 'url', target: '_blank'}) }
  </code></pre>
  
  <p>The test will always succeed regardless of the presence or value of the target attribute in the actual page and link being tested.  Changing the href attribute does cause a test failure as expected.  I thought the options hash for have_link was a list of attributes to test for. Apparently I'm wrong, but what's the best way to test a single link for it's target attribute?  Hopefully it's not to use an XPath search...</p>