Capybara Ambiguity Resolution

capybara, rspec, ruby-on-rails-3

Solution

My solution is

first(:link, link).click

instead of

click_link(link)

Problem

How do I resolve ambiguity in Capybara? For some reason I need links with the same values in a page but I can't create a test since I get the error ``` Failure/Error: click_link("#tag1") Capybara::Ambiguous: Ambiguous match, found 2 elements matching link "#tag1" ``` The reason why I can't avoid this is because of the design. I'm trying to recreate the twitter page with tweets/tags on the right and the tags on the left of the page. Therefore it will be inevitable that identical links page shows up on the same page.

Original source