[rspec-users] View Specs Fail with "protected method render"

Jeff Dean jeff at jefdean.com
Tue Apr 10 20:21:03 EDT 2007

I've got rspec and zentest installed as well as the rspec rails plugin, and
my model/controller specs all pass and work well.  I can't seem to get views
to work though - 100% of the specs fail with:

NoMethodError in '/users/show.rhtml should render attributes in <p>'
protected method `render' called for

Note the "protected method `render' called for

Here's an example spec:

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

context "/users/new.rhtml" do
  include UsersHelper

  setup do
    @errors = mock("errors")

    @user = mock_user
    @user.stub!(:errors).and_return @errors
    assigns[:user] = @user

  specify "should render new form" do
    render "/users/new.rhtml"
    response.should_have_tag 'form', :attributes =>{:action => users_path,
:method => 'post'}


Can anyone think of why "render" is protected?  Is this a versioning issue?

Thanks - Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070410/58f2a03d/attachment.html 

More information about the rspec-users mailing list