[Rspec-devel] Some handy rails helpers

aslak hellesoy aslak.hellesoy at gmail.com
Sun Jul 9 10:47:18 EDT 2006


On 7/9/06, David Chelimsky <dchelimsky at gmail.com> wrote:
> On 7/4/06, Jay Levitt <lists-rspec at shopwatch.org> wrote:
> > Luke Redpath wrote:
> > > Hi Jay
> > >
> > > These look really cool, and your post got my thinking. I've always hated
> > > how clunky the assert_tag function that come with Rails is. Wouldn't it
> > > be really cool to have a DSL that merges in with rSpec for testing your
> > > HTML output - kind of like integration tests but I was thinking more
> > > about speccing particular controller actions (under their various
> > > contexts) and their resulting views. Something like this would be really
> > > cool:
> > >
> > > tag('h1', :id => 'pageheader').should_contain('My Great Website')
> > >
> > > Or even better:
> > >
> > > h1(:id => 'pageheader').should_contain('My Great Website')
> > > div(:id => 'somediv').should_have_class_name('hidden')
>
> YES! Much more rspec-ish. Luke - have you done any work on this?

I think building something like this on top of hpricot or Rails' html
scanner should be fairly straightforward.

Aslak

> _______________________________________________
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>


More information about the Rspec-devel mailing list