[rspec-users] questions rspec on rails

Anthony Carlos anthony at digitalphenom.com
Tue May 29 08:36:57 EDT 2007


On May 29, 2007, at 4:54 AM, Jonathan Linowes wrote:

> Hi, rather than flooding this list with separate emails, I've been
> queueing up questions using rspec with rails. (an irc channel would
> be nice too :) Here ya go...
>
> - Can you assert which layout template is rendered in a controller  
> spec?
>

I'll answer this one:

response.should render_template()

Don't forget to include either a GET or POST, and if you're using  
stubs or mocks, watch test.log for errors. I've noticed that when I  
stub out a model object, for example, if I don't stub out all the  
methods that get called before the action gets to my render, then the  
spec fails but without a lot of related info. test.log will usually  
give me a hint with a stack trace.

It's documented here: http://rspec.rubyforge.org/documentation/rails/ 
writing/controllers.html

>
> That's it for now :) thanks
> linoj
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list