[Rspec-devel] Some handy rails helpers

David Chelimsky dchelimsky at gmail.com
Sun Jul 9 06:51:24 EDT 2006


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?


More information about the Rspec-devel mailing list