[rspec-users] Testing item links in Webrat (was: Cucumber)

Mark Thomson mark.thomson at ieee.org
Sun Oct 26 20:01:42 EDT 2008


aslak hellesoy wrote:
> On Sun, Oct 26, 2008 at 11:30 PM, Mark Thomson <mark.thomson at ieee.org> wrote:
>   
>> 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.
>>
>>     
>
> This is a Webrat question - not a Cucumber question.
>   

Only if you know the answer :-)

>   
>> 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
>>     
>
> Use the #clicks_link_within method in Webrat.
>
> Aslak
>   

Thanks Aslak. You've made me realize I have been looking at an old 
version of the documentation, here: 
http://www.brynary.com/uploads/webrat/rdoc/index.html. So I didn't 
realize there was a click_links_within method. Google has just led me 
here: http://webrat.rubyforge.org/.

Mark.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081026/532620ea/attachment.html>


More information about the rspec-users mailing list