In a view file I have:
= link_to \'View\', post = link_to \'View\', comment
In a spec file (I\'m using Capybara):
click_on
For capybara 2 solution:
capybara 2
within(".comment") do click_on("View") end
would not help if you have a few .comment. So simple use: page.first(:link, "View").click
.comment
page.first(:link, "View").click