[rspec-users] template.expects_render?

Leslie Freeman leslief at sunquake.net
Sat Sep 8 15:47:58 EDT 2007

Hi All,
I'm trying to make use of template.expects_render, is outlined in  
David's post(http://blog.davidchelimsky.net/articles/2007/06/28/ 
template-expects_render). I get an undefined method error on  
expects_render. I made sure I had the 1.0.8 gem as well as  
reinstalling the plugin and redoing the bootstrap. Still no luck. So  
I created a clean project, installed the CURRENT plugin, ran script/ 
generate rspec and generated a vanilla rspec scaffold. I added the  
template.should_render to a view spec, and am still getting the  
undefined method error.

I had assumed this method would be available in 1.0.8, as it was  
supposed to be added to 1.0.6. Am I wrong? Or am I missing something  
crucial about the usage?


Below is my view spec:

require File.dirname(__FILE__) + '/../../spec_helper'

describe "/apples/index.rhtml" do
   include ApplesHelper

   before do
     apple_98 = mock_model(Apple)
     apple_99 = mock_model(Apple)

     assigns[:apples] = [apple_98, apple_99]

   it "should render list of apples" do
     template.should_render(:partial => 'apples/apple')
     render "/apples/index.rhtml"

More information about the rspec-users mailing list