Topic: Include layout when writing view rspecs?

Is there any easy way to render the whole layout (i.e. including application.html.erb and everything it renders) when doing a view spec?

My view development style has tended more and more towards storing things with content_for to be rendered by the app layout, or setting variables that alter the way the app layout does things.

This means that large parts of my view never actually get rendered when i write a view rspec that calls "render 'controller/action'", so I can't spec them easily.

I'd like to just render the whole stack, including the layout, and spec the results of that.   

Thanks,
Evan

Re: Include layout when writing view rspecs?

I would strongly suggest that controller and view specs aren't great and that cucumber is a much better way of testing this aspect of your application.

Re: Include layout when writing view rspecs?

Learning cucumber is on the "to do" list, but we have three apps up and running that would be much better if we could spec certain things about the views in them before we have time to add cucumber to our process.

Re: Include layout when writing view rspecs?

I can't help you there, sorry, I found view specs to be brittle and difficult to setup and maintain so they went by the wayside.