[rspec-users] help with webrat and selectors

Jonathan Linowes jonathan at parkerhill.com
Fri Sep 19 15:38:43 EDT 2008


nevermind, hpricot to the rescue
:)

On Sep 19, 2008, at 3:01 PM, Jonathan Linowes wrote:

> Hi, sorry if this isnt directly an rspec question but maybe someone  
> can help
>
> lets say a page contains a list setup like this
> <ul id="list">
>   <li id="item_1"><a href="#">Item One</a></li>
>   <li id="item_2"><a href="#">Item Two</a></li>
>   <li id="item_3"><a href="#">Item Three</a></li>
> </ul>
>
> in my story i want to refer to "first item", "second item" and  
> "last item" rather than by name
> What I'd like is to
> - get the n'th item's numeric id
> - get the n'th item's link
>
> so i can do something like
> 	@item = Item.find( id )
> or
> 	visit link
>
> thanks
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list