On Tue, Mar 10, 2009 at 8:16 AM, Bart Zonneveld <[email protected]> wrote:
> Hey list,
>
> Quick question: How can I check that a given word appears a number of times
> on a page?
> The page in question includes some XML, rendered with &lts and &gts and I
> want to test that a given node exists 10 times on that page.

You want to make sure you have 10 nodes? Or that text shows up 10
times inside of any node?

You can utilize Webrat's #have_selector to count the nodes, ie:

        response.should have_selector("li", :count => 3)


>
> thanks!
> bartz
> _______________________________________________
> rspec-users mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/rspec-users
>



-- 
Zach Dennis
http://www.continuousthinking.com
http://www.mutuallyhuman.com
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to