[rspec-users] have_tag + quantity - question
patnakajima at gmail.com
Fri Mar 6 17:42:24 EST 2009
I've posted it on this list before, but if you're writing view tests, check
It provides a much cleaner way of asserting on markup, and doesn't require
you to litter your expectations with CSS selectors.
On Fri, Mar 6, 2009 at 3:40 PM, Stephen Eley <sfeley at gmail.com> wrote:
> On Fri, Mar 6, 2009 at 3:55 AM, David Chelimsky <dchelimsky at gmail.com>
> > On Thu, Mar 5, 2009 at 7:40 AM, MAwiniarski <MAwiniarski at gmail.com>
> >> Is there a way to check quantity of tags?
> > response.should have_tag('div', 4)
> Ooh! Thank you; I wish I'd known that before. All this time I've
> been using annoyingly complicated xpath tests:
> Then /^I should see (\d+) people$/ do |num|
> Have Fun,
> Steve Eley (sfeley at gmail.com)
> ESCAPE POD - The Science Fiction Podcast Magazine
> rspec-users mailing list
> rspec-users at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users