[rspec-users] help with webrat and selectors

Jonathan Linowes jonathan at parkerhill.com
Fri Sep 19 15:01:31 EDT 2008


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


More information about the rspec-users mailing list