[Nitro] testing views

Dan North dan at tastapod.com
Tue Sep 18 10:15:57 EDT 2007


Hi there.

I ran a BDD tutorial at RailsConf on a rails app, and I'm trying to redo 
it in nitro to present a side-by-side example.

I'm using 0.41.0 and I don't know how to test the output of a view in 
isolation.

What I want to do is something like:

- set up some @properties
- invoke rendering on a .xhtml view (ideally by just passing the view 
name to something)
- get the xhtml result as a string (or DOM) that I can verify using xpath

Any ideas?

Thanks,
Dan

ps. I found the TestCase mixin. Any reason why you're hacking 
Test::Unit::TestCase rather than defining a NitroTestCase subclass?


More information about the Nitro-general mailing list