dchelimsky at gmail.com
Sat Sep 8 16:11:24 EDT 2007
On 9/8/07, Leslie Freeman <leslief at sunquake.net> wrote:
> 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')
The method is expect_render, not should_render.
> render "/apples/index.rhtml"
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users