[rspec-users] testing a render layout statement in a controller

Harry Bishop lists at ruby-forum.com
Fri Oct 31 13:26:17 EDT 2008

Bart Zonneveld wrote:
> On 16-okt-2008, at 8:50, Dave Gamphani Phiri wrote:
>> Here, I was trying to test if the out put displays with a layouts/menu
>> template.
>> Can somebody help on how you test the render(:layout => "layouts/
>> menu") statement in a controller or this is supposed to be tested in
>> the view?
> Try this:
> render(:layout => "layouts/menu") and return
> cheers,
> bartz

Thanks Bartz, I used your input to try a controller line of
    format.html { render :action => "show" }
and rspec of
    response.should render_template( :(controller name) => "/show")

I tried it with and without the "and return" and both worked.


Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list