[rspec-users] render_template giving an odd error?

Matt Darby matt at matt-darby.com
Tue Oct 5 09:03:55 EDT 2010

Hey all, I'm trying to migrate over to Rails3/RSpec2 and I cannot seem
to get the specing of `render` right. I know there was some changes in
RSpec2 that affect this, and I was hoping to get a bit of help.

I have this is in a before block in a view spec:

view.should render_template("attachments/index", :locals => {:obj =>

When I run the spec, it bombs out with this error:

expecting <"attachments/index"> but rendering with <"">.
Expected block to return true value.

This doesn't tell me much, and aside from the RSpec2 syntax updates
the spec hasn't changed (and used to work in Rails2).

This is a huge blocker for my app migration. I have 150+ models and
use partials pretty often.

Help is appreciated!

More information about the rspec-users mailing list