Forum: RSpec Testing item links in Cucumber

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
07dd367bcc4ae602d640ec8c1b280df6?d=identicon&s=25 Mark Thomson (Guest)
on 2008-10-26 23:33
(Received via mailing list)
I have an index template that contains a tabulated list of database
items, each of which has an associated "display" link that enables the
item to be displayed via a "show" action. In Cucumber I know how to test
that the show template is rendered when one of those links is clicked
using webrat's "click_link" method and response.should render_template.

What I'm not sure about is whether it's possible to specify that a
particular link gets clicked, since there are multiple links on the page
with the same text. I'd like to be able to test that the particular
database record that gets used in the show template corresponds to the
one whose display link was clicked.

Any thoughts on this? Is a story-level test the right place to be
checking this, or should it be handled in an object level test?

Mark.
This topic is locked and can not be replied to.