title: What is the correct way to check a link in a cucumber test?
body: <p>I have been unable to find an answer to this question. I want to write a simple step in Cucumber to check a link is present on a page and that it has the correct text and href. Something like this:</p>
  
  <pre><code>Then /^I see the page with link "(.*?)" to "(.*?)"$/ do |link,url|
    page.should have_xpath("//a[text()='#{link}',@href='#{url}']")
  end
  </code></pre>
  
  <p>Except that doesn't work. THe xpath syntax is incorrect and I have struggled to find a good explanation of the syntax.</p>
  
  <p>Thanks!</p>