[Ruby] Rails view testing questions

Eric Hodel drbrain at segment7.net
Wed Sep 20 23:05:04 PDT 2006


On Sep 19, 2006, at 12:51 PM, Joe Van Dyk wrote:

> Hi,
>
> Using the view testing functionality of ZenTest (when's that going to
> be incorporated into Rails, btw?),

Likely never.  I don't think anybody on the core team really tests.

> you can test each view and partial individually.  Which is super.
>
> But, how can you test to see that a partial is actually being rendered
> correctly by a view?  Say I accidently delete the call to the partial
> in the view.  How could a test pick up on that?

I don't know yet.  There's an idea in the comments here:

http://blog.segment7.net/articles/2006/09/08/render_tree-for-rails

But that one is too complicated.  I may do something simpler.

> Also, is there a way to do something like deny_form, deny_input, etc?

See deny_links_to for ideas.  I haven't needed it, so I haven't  
written it (patches welcome).

-- 
Eric Hodel - drbrain at segment7.net - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com




More information about the Ruby mailing list