Jeff Dean
2007-Apr-11 00:21 UTC
[rspec-users] View Specs Fail with "protected method render"
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 #<Spec::Rails::Runner::ViewSpecController:0x3197dfc> /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in `render'' ./spec/views/users/show_rhtml_spec.rb:13: Note the "protected method `render'' called for #<Spec::Rails::Runner::ViewSpecController:0x3197dfc>" Here''s an example spec: require File.dirname(__FILE__) + ''/../../spec_helper'' context "/users/new.rhtml" do include UsersHelper setup do @errors = mock("errors") @errors.stub!(:count).and_return(0) @user = mock_user @user.stub!(:errors).and_return @errors assigns[:user] = @user end specify "should render new form" do render "/users/new.rhtml" response.should_have_tag ''form'', :attributes =>{:action => users_path, :method => ''post''} end end 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
aslak hellesoy
2007-Apr-12 16:24 UTC
[rspec-users] View Specs Fail with "protected method render"
On 4/11/07, Jeff Dean <jeff at jefdean.com> wrote:> 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 > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc> > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > `render'' > ./spec/views/users/show_rhtml_spec.rb:13: > > Note the "protected method `render'' called for > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc>" > > Here''s an example spec: > > require File.dirname(__FILE__) + ''/../../spec_helper'' > > context "/users/new.rhtml" do > include UsersHelper > > setup do > @errors = mock("errors") > @errors.stub!(:count).and_return(0) > > @user = mock_user > @user.stub!(:errors).and_return @errors > assigns[:user] = @user > end > > specify "should render new form" do > render "/users/new.rhtml" > response.should_have_tag ''form'', :attributes =>{:action => users_path, > :method => ''post''} > > end > end > > Can anyone think of why "render" is protected? Is this a versioning issue? >What versions of everything do you have?> Thanks - Jeff > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Jeff Dean
2007-Apr-18 21:48 UTC
[rspec-users] View Specs Fail with "protected method render"
zentest -v = zentest v3.4.3 spec -v = RSpec-0.8.2 (r1560) - BDD for Ruby spec_on_rails is a checkout of REL_0_8_2 aslak hellesoy wrote:> > On 4/11/07, Jeff Dean <jeff at jefdean.com> wrote: >> 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 >> #<Spec::Rails::Runner::ViewSpecController:0x3197dfc> >> /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in >> `render'' >> ./spec/views/users/show_rhtml_spec.rb:13: >> >> Note the "protected method `render'' called for >> #<Spec::Rails::Runner::ViewSpecController:0x3197dfc>" >> >> Here''s an example spec: >> >> require File.dirname(__FILE__) + ''/../../spec_helper'' >> >> context "/users/new.rhtml" do >> include UsersHelper >> >> setup do >> @errors = mock("errors") >> @errors.stub!(:count).and_return(0) >> >> @user = mock_user >> @user.stub!(:errors).and_return @errors >> assigns[:user] = @user >> end >> >> specify "should render new form" do >> render "/users/new.rhtml" >> response.should_have_tag ''form'', :attributes =>{:action => >> users_path, >> :method => ''post''} >> >> end >> end >> >> Can anyone think of why "render" is protected? Is this a versioning >> issue? >> > > What versions of everything do you have? > >-- View this message in context: http://www.nabble.com/View-Specs-Fail-with-%22protected-method-render%22-tf3566514.html#a10066654 Sent from the rspec-users mailing list archive at Nabble.com.
aslak hellesoy
2007-Apr-19 15:52 UTC
[rspec-users] View Specs Fail with "protected method render"
Rails version? On 4/18/07, Jeff Dean <jeff at jefdean.com> wrote:> > zentest -v = zentest v3.4.3 > spec -v = RSpec-0.8.2 (r1560) - BDD for Ruby > spec_on_rails is a checkout of REL_0_8_2 > > > aslak hellesoy wrote: > > > > On 4/11/07, Jeff Dean <jeff at jefdean.com> wrote: > >> 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 > >> #<Spec::Rails::Runner::ViewSpecController:0x3197dfc> > >> > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > >> `render'' > >> ./spec/views/users/show_rhtml_spec.rb:13: > >> > >> Note the "protected method `render'' called for > >> #<Spec::Rails::Runner::ViewSpecController:0x3197dfc>" > >> > >> Here''s an example spec: > >> > >> require File.dirname(__FILE__) + ''/../../spec_helper'' > >> > >> context "/users/new.rhtml" do > >> include UsersHelper > >> > >> setup do > >> @errors = mock("errors") > >> @errors.stub!(:count).and_return(0) > >> > >> @user = mock_user > >> @user.stub!(:errors).and_return @errors > >> assigns[:user] = @user > >> end > >> > >> specify "should render new form" do > >> render "/users/new.rhtml" > >> response.should_have_tag ''form'', :attributes =>{:action => > >> users_path, > >> :method => ''post''} > >> > >> end > >> end > >> > >> Can anyone think of why "render" is protected? Is this a versioning > >> issue? > >> > > > > What versions of everything do you have? > > > > > > -- > View this message in context: > http://www.nabble.com/View-Specs-Fail-with-%22protected-method-render%22-tf3566514.html#a10066654 > Sent from the rspec-users mailing list archive at Nabble.com. > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Jeff Dean
2007-Apr-19 16:03 UTC
[rspec-users] View Specs Fail with "protected method render"
Edge - revision 6512 On 4/19/07, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:> > Rails version? > > On 4/18/07, Jeff Dean <jeff at jefdean.com> wrote: > > > > zentest -v = zentest v3.4.3 > > spec -v = RSpec-0.8.2 (r1560) - BDD for Ruby > > spec_on_rails is a checkout of REL_0_8_2 > > > > > > aslak hellesoy wrote: > > > > > > On 4/11/07, Jeff Dean <jeff at jefdean.com> wrote: > > >> 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 > > >> #<Spec::Rails::Runner::ViewSpecController:0x3197dfc> > > >> > > > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > > >> `render'' > > >> ./spec/views/users/show_rhtml_spec.rb:13: > > >> > > >> Note the "protected method `render'' called for > > >> #<Spec::Rails::Runner::ViewSpecController:0x3197dfc>" > > >> > > >> Here''s an example spec: > > >> > > >> require File.dirname(__FILE__) + ''/../../spec_helper'' > > >> > > >> context "/users/new.rhtml" do > > >> include UsersHelper > > >> > > >> setup do > > >> @errors = mock("errors") > > >> @errors.stub!(:count).and_return(0) > > >> > > >> @user = mock_user > > >> @user.stub!(:errors).and_return @errors > > >> assigns[:user] = @user > > >> end > > >> > > >> specify "should render new form" do > > >> render "/users/new.rhtml" > > >> response.should_have_tag ''form'', :attributes =>{:action => > > >> users_path, > > >> :method => ''post''} > > >> > > >> end > > >> end > > >> > > >> Can anyone think of why "render" is protected? Is this a versioning > > >> issue? > > >> > > > > > > What versions of everything do you have? > > > > > > > > > > -- > > View this message in context: > > > http://www.nabble.com/View-Specs-Fail-with-%22protected-method-render%22-tf3566514.html#a10066654 > > Sent from the rspec-users mailing list archive at Nabble.com. > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070419/f17c5e4b/attachment.html
David Chelimsky
2007-Apr-19 16:05 UTC
[rspec-users] View Specs Fail with "protected method render"
On 4/10/07, Jeff Dean <jeff at jefdean.com> wrote:> 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 > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc> > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > `render'' > ./spec/views/users/show_rhtml_spec.rb:13: > > Note the "protected method `render'' called for > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc>" > > Here''s an example spec: > > require File.dirname(__FILE__) + ''/../../spec_helper'' > > context "/users/new.rhtml" do > include UsersHelper > > setup do > @errors = mock("errors") > @errors.stub!(:count).and_return(0) > > @user = mock_user > @user.stub!(:errors).and_return @errors > assigns[:user] = @user > end > > specify "should render new form" do > render "/users/new.rhtml" > response.should_have_tag ''form'', :attributes =>{:action => users_path, > :method => ''post''} > > end > end > > Can anyone think of why "render" is protected? Is this a versioning issue?It''s protected in ActionController::Base in rails >= 1.2.3 (perhaps before), so Spec::Rails made it protected as well. You mentioned that you''ve got zentest installed - what does that have to do with this problem? RSpec''s dependency on ZenTest has been gone for quite some time now. Are you running specs w/ autotest or rspec_autotest?> > Thanks - Jeff > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Jeff Dean
2007-Apr-19 16:08 UTC
[rspec-users] View Specs Fail with "protected method render"
I run the view specs with rake spec:views. I mentioned zentest only because I wasn''t sure if it affected the specs in any way. If render is protected, how should I be writing my view specs? On 4/19/07, David Chelimsky <dchelimsky at gmail.com> wrote:> > On 4/10/07, Jeff Dean <jeff at jefdean.com> wrote: > > 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 > > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc> > > > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > > `render'' > > ./spec/views/users/show_rhtml_spec.rb:13: > > > > Note the "protected method `render'' called for > > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc>" > > > > Here''s an example spec: > > > > require File.dirname(__FILE__) + ''/../../spec_helper'' > > > > context "/users/new.rhtml" do > > include UsersHelper > > > > setup do > > @errors = mock("errors") > > @errors.stub!(:count).and_return(0) > > > > @user = mock_user > > @user.stub!(:errors).and_return @errors > > assigns[:user] = @user > > end > > > > specify "should render new form" do > > render "/users/new.rhtml" > > response.should_have_tag ''form'', :attributes =>{:action => > users_path, > > :method => ''post''} > > > > end > > end > > > > Can anyone think of why "render" is protected? Is this a versioning > issue? > > It''s protected in ActionController::Base in rails >= 1.2.3 (perhaps > before), so Spec::Rails made it protected as well. > > You mentioned that you''ve got zentest installed - what does that have > to do with this problem? RSpec''s dependency on ZenTest has been gone > for quite some time now. Are you running specs w/ autotest or > rspec_autotest? > > > > > > Thanks - Jeff > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070419/42dac137/attachment.html
David Chelimsky
2007-Apr-19 16:31 UTC
[rspec-users] View Specs Fail with "protected method render"
On 4/19/07, Jeff Dean <jeff at jefdean.com> wrote:> I run the view specs with rake spec:views. I mentioned zentest only because > I wasn''t sure if it affected the specs in any way. > > If render is protected, how should I be writing my view specs?#render is protected on the controller - not within your spec - so saying ... it "should render new form" do render "/users/new.rhtml" ... end ... is fine. I think the message about render is a red herring. I''m not sure what the real problem is from the info we''ve got so far. Would you mind doing this: spec spec/views/users/show_rhtml_spec.rb -b If you are using rspec installed as a plugin then do this: vendor/rspec/bin/spec spec/views/users/show_rhtml_spec.rb -b That will provide the full backtrace info which might help diagnose this. Thanks, David> > > On 4/19/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > On 4/10/07, Jeff Dean <jeff at jefdean.com> wrote: > > > 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 > > > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc> > > > > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > > > `render'' > > > ./spec/views/users/show_rhtml_spec.rb:13: > > > > > > Note the "protected method `render'' called for > > > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc>" > > > > > > Here''s an example spec: > > > > > > require File.dirname(__FILE__) + ''/../../spec_helper'' > > > > > > context "/users/new.rhtml" do > > > include UsersHelper > > > > > > setup do > > > @errors = mock("errors") > > > @errors.stub!(:count).and_return(0) > > > > > > @user = mock_user > > > @user.stub!(:errors).and_return @errors > > > assigns[:user] = @user > > > end > > > > > > specify "should render new form" do > > > render "/users/new.rhtml" > > > response.should_have_tag ''form'', :attributes =>{:action => > users_path, > > > :method => ''post''} > > > > > > end > > > end > > > > > > Can anyone think of why "render" is protected? Is this a versioning > issue? > > > > It''s protected in ActionController::Base in rails >= 1.2.3 (perhaps > > before), so Spec::Rails made it protected as well. > > > > You mentioned that you''ve got zentest installed - what does that have > > to do with this problem? RSpec''s dependency on ZenTest has been gone > > for quite some time now. Are you running specs w/ autotest or > > rspec_autotest? > > > > > > > > > > Thanks - Jeff > > > > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Jeff Dean
2007-Apr-19 17:11 UTC
[rspec-users] View Specs Fail with "protected method render"
Thanks for all of your help on this. By the way - is there a donate link anywhere? Here''s the result of spec spec/views/users/show_rhtml_spec.rb -b NoMethodError in ''/users/show.rhtml should render attributes in <p>'' protected method `render'' called for #<Spec::Rails::Runner::ViewSpecController:0x31388d4> /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/expectations/sugar.rb:14:in `call'' /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/expectations/sugar.rb:14:in `_method_missing'' /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/expectations/sugar.rb:10:in `method_missing'' /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in `render'' ./spec/views/users/show_rhtml_spec.rb:13: /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/specification.rb:66:in `instance_eval'' /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/specification.rb:66:in `execute_spec'' /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/specification.rb:31:in `run'' /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context.rb:37:in `run'' /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context.rb:34:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context.rb:34:in `run'' /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context_runner.rb:21:in `run'' /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context_runner.rb:20:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context_runner.rb:20:in `run'' /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/command_line.rb:29:in `run'' /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/bin/spec:4: /usr/local/bin/spec:18:in `load'' /usr/local/bin/spec:18: On 4/19/07, David Chelimsky <dchelimsky at gmail.com> wrote:> > On 4/19/07, Jeff Dean <jeff at jefdean.com> wrote: > > I run the view specs with rake spec:views. I mentioned zentest only > because > > I wasn''t sure if it affected the specs in any way. > > > > If render is protected, how should I be writing my view specs? > > #render is protected on the controller - not within your spec - so saying > ... > > it "should render new form" do > render "/users/new.rhtml" > ... > end > > ... is fine. > > I think the message about render is a red herring. I''m not sure what > the real problem is from the info we''ve got so far. Would you mind > doing this: > > spec spec/views/users/show_rhtml_spec.rb -b > > If you are using rspec installed as a plugin then do this: > > vendor/rspec/bin/spec spec/views/users/show_rhtml_spec.rb -b > > That will provide the full backtrace info which might help diagnose this. > > Thanks, > David > > > > > > > On 4/19/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > On 4/10/07, Jeff Dean <jeff at jefdean.com> wrote: > > > > 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 > > > > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc> > > > > > > > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > > > > `render'' > > > > ./spec/views/users/show_rhtml_spec.rb:13: > > > > > > > > Note the "protected method `render'' called for > > > > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc>" > > > > > > > > Here''s an example spec: > > > > > > > > require File.dirname(__FILE__) + ''/../../spec_helper'' > > > > > > > > context "/users/new.rhtml" do > > > > include UsersHelper > > > > > > > > setup do > > > > @errors = mock("errors") > > > > @errors.stub!(:count).and_return(0) > > > > > > > > @user = mock_user > > > > @user.stub!(:errors).and_return @errors > > > > assigns[:user] = @user > > > > end > > > > > > > > specify "should render new form" do > > > > render "/users/new.rhtml" > > > > response.should_have_tag ''form'', :attributes =>{:action => > > users_path, > > > > :method => ''post''} > > > > > > > > end > > > > end > > > > > > > > Can anyone think of why "render" is protected? Is this a versioning > > issue? > > > > > > It''s protected in ActionController::Base in rails >= 1.2.3 (perhaps > > > before), so Spec::Rails made it protected as well. > > > > > > You mentioned that you''ve got zentest installed - what does that have > > > to do with this problem? RSpec''s dependency on ZenTest has been gone > > > for quite some time now. Are you running specs w/ autotest or > > > rspec_autotest? > > > > > > > > > > > > > > Thanks - Jeff > > > > > > > > _______________________________________________ > > > > rspec-users mailing list > > > > rspec-users at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070419/619bdeb6/attachment.html
David Chelimsky
2007-Apr-19 17:57 UTC
[rspec-users] View Specs Fail with "protected method render"
On 4/19/07, Jeff Dean <jeff at jefdean.com> wrote:> Thanks for all of your help on this. By the way - is there a donate link > anywhere? > > Here''s the result of spec spec/views/users/show_rhtml > _spec.rb -b > NoMethodError in ''/users/show.rhtml should render attributes in <p>'' > protected method `render'' called for > #<Spec::Rails::Runner::ViewSpecController:0x31388d4> > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/expectations/sugar.rb:14:in > `call'' > /usr/local/lib/ruby/gems/1.8/gems/rspec- > 0.8.2/lib/spec/expectations/sugar.rb:14:in > `_method_missing'' > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/expectations/sugar.rb:10:in > `method_missing'' > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > `render'' > ./spec/views/users/show_rhtml_spec.rb:13: > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/specification.rb:66:in > `instance_eval'' > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/specification.rb:66:in > `execute_spec'' > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/specification.rb:31:in > `run'' > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context.rb:37:in > `run'' > /usr/local/lib/ruby/gems/1.8/gems/rspec- > 0.8.2/lib/spec/runner/context.rb:34:in `each'' > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context.rb:34:in > `run'' > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context_runner.rb:21:in > `run'' > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context_runner.rb:20:in > `each'' > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context_runner.rb:20:in > `run'' > /usr/local/lib/ruby/gems/1.8/gems/rspec- > 0.8.2/lib/spec/runner/command_line.rb:29:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/bin/spec:4: > /usr/local/bin/spec:18:in `load'' > /usr/local/bin/spec:18:Well, I''m not sure why there is a conflict between rspec 0.8.2 and edge rails, but there is apparently. I tried this w/ rails 1.2.3 and also using edge rails/edge rspec - in both cases there was no problem. I guess if you''re using edge rails you should probably be using edge rspec too.> > > On 4/19/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > On 4/19/07, Jeff Dean <jeff at jefdean.com> wrote: > > > I run the view specs with rake spec:views. I mentioned zentest only > because > > > I wasn''t sure if it affected the specs in any way. > > > > > > If render is protected, how should I be writing my view specs? > > > > #render is protected on the controller - not within your spec - so saying > ... > > > > it "should render new form" do > > render "/users/new.rhtml" > > ... > > end > > > > ... is fine. > > > > I think the message about render is a red herring. I''m not sure what > > the real problem is from the info we''ve got so far. Would you mind > > doing this: > > > > spec spec/views/users/show_rhtml_spec.rb -b > > > > If you are using rspec installed as a plugin then do this: > > > > vendor/rspec/bin/spec spec/views/users/show_rhtml_spec.rb > -b > > > > That will provide the full backtrace info which might help diagnose this. > > > > Thanks, > > David > > > > > > > > > > > On 4/19/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > > > On 4/10/07, Jeff Dean < jeff at jefdean.com> wrote: > > > > > 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 > > > > > > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc> > > > > > > > > > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > > > > > `render'' > > > > > ./spec/views/users/show_rhtml_spec.rb:13: > > > > > > > > > > Note the "protected method `render'' called for > > > > > > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc>" > > > > > > > > > > Here''s an example spec: > > > > > > > > > > require File.dirname(__FILE__) + ''/../../spec_helper'' > > > > > > > > > > context "/users/new.rhtml" do > > > > > include UsersHelper > > > > > > > > > > setup do > > > > > @errors = mock("errors") > > > > > @errors.stub!(:count).and_return(0) > > > > > > > > > > @user = mock_user > > > > > @user.stub!(:errors).and_return @errors > > > > > assigns[:user] = @user > > > > > end > > > > > > > > > > specify "should render new form" do > > > > > render "/users/new.rhtml" > > > > > response.should_have_tag ''form'', :attributes =>{:action => > > > users_path, > > > > > :method => ''post''} > > > > > > > > > > end > > > > > end > > > > > > > > > > Can anyone think of why "render" is protected? Is this a versioning > > > issue? > > > > > > > > It''s protected in ActionController::Base in rails >= 1.2.3 (perhaps > > > > before), so Spec::Rails made it protected as well. > > > > > > > > You mentioned that you''ve got zentest installed - what does that have > > > > to do with this problem? RSpec''s dependency on ZenTest has been gone > > > > for quite some time now. Are you running specs w/ autotest or > > > > rspec_autotest? > > > > > > > > > > > > > > > > > > Thanks - Jeff > > > > > > > > > > _______________________________________________ > > > > > rspec-users mailing list > > > > > rspec-users at rubyforge.org > > > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > > > > _______________________________________________ > > > > rspec-users mailing list > > > > rspec-users at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > > > > > > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Jeff Dean
2007-Apr-19 18:56 UTC
[rspec-users] View Specs Fail with "protected method render"
Are you planning an major breaking changes in edge spec soon? I have to figure out if I want to go edge/edge or stable/stable, and if there aren''t any huge feature changes coming down the line I think I''ll go with edge. On 4/19/07, David Chelimsky <dchelimsky at gmail.com> wrote:> > On 4/19/07, Jeff Dean <jeff at jefdean.com> wrote: > > Thanks for all of your help on this. By the way - is there a donate > link > > anywhere? > > > > Here''s the result of spec spec/views/users/show_rhtml > > _spec.rb -b > > NoMethodError in ''/users/show.rhtml should render attributes in <p>'' > > protected method `render'' called for > > #<Spec::Rails::Runner::ViewSpecController:0x31388d4> > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2 > /lib/spec/expectations/sugar.rb:14:in > > `call'' > > /usr/local/lib/ruby/gems/1.8/gems/rspec- > > 0.8.2/lib/spec/expectations/sugar.rb:14:in > > `_method_missing'' > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2 > /lib/spec/expectations/sugar.rb:10:in > > `method_missing'' > > > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > > `render'' > > ./spec/views/users/show_rhtml_spec.rb:13: > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2 > /lib/spec/runner/specification.rb:66:in > > `instance_eval'' > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2 > /lib/spec/runner/specification.rb:66:in > > `execute_spec'' > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2 > /lib/spec/runner/specification.rb:31:in > > `run'' > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2 > /lib/spec/runner/context.rb:37:in > > `run'' > > /usr/local/lib/ruby/gems/1.8/gems/rspec- > > 0.8.2/lib/spec/runner/context.rb:34:in `each'' > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2 > /lib/spec/runner/context.rb:34:in > > `run'' > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2 > /lib/spec/runner/context_runner.rb:21:in > > `run'' > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2 > /lib/spec/runner/context_runner.rb:20:in > > `each'' > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2 > /lib/spec/runner/context_runner.rb:20:in > > `run'' > > /usr/local/lib/ruby/gems/1.8/gems/rspec- > > 0.8.2/lib/spec/runner/command_line.rb:29:in `run'' > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/bin/spec:4: > > /usr/local/bin/spec:18:in `load'' > > /usr/local/bin/spec:18: > > Well, I''m not sure why there is a conflict between rspec 0.8.2 and > edge rails, but there is apparently. I tried this w/ rails 1.2.3 and > also using edge rails/edge rspec - in both cases there was no problem. > I guess if you''re using edge rails you should probably be using edge > rspec too. > > > > > > > > > On 4/19/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > On 4/19/07, Jeff Dean <jeff at jefdean.com> wrote: > > > > I run the view specs with rake spec:views. I mentioned zentest only > > because > > > > I wasn''t sure if it affected the specs in any way. > > > > > > > > If render is protected, how should I be writing my view specs? > > > > > > #render is protected on the controller - not within your spec - so > saying > > ... > > > > > > it "should render new form" do > > > render "/users/new.rhtml" > > > ... > > > end > > > > > > ... is fine. > > > > > > I think the message about render is a red herring. I''m not sure what > > > the real problem is from the info we''ve got so far. Would you mind > > > doing this: > > > > > > spec spec/views/users/show_rhtml_spec.rb -b > > > > > > If you are using rspec installed as a plugin then do this: > > > > > > vendor/rspec/bin/spec spec/views/users/show_rhtml_spec.rb > > -b > > > > > > That will provide the full backtrace info which might help diagnose > this. > > > > > > Thanks, > > > David > > > > > > > > > > > > > > > On 4/19/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > > > > > On 4/10/07, Jeff Dean < jeff at jefdean.com> wrote: > > > > > > 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 > > > > > > > > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc> > > > > > > > > > > > > > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > > > > > > `render'' > > > > > > ./spec/views/users/show_rhtml_spec.rb:13: > > > > > > > > > > > > Note the "protected method `render'' called for > > > > > > > > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc>" > > > > > > > > > > > > Here''s an example spec: > > > > > > > > > > > > require File.dirname(__FILE__) + ''/../../spec_helper'' > > > > > > > > > > > > context "/users/new.rhtml" do > > > > > > include UsersHelper > > > > > > > > > > > > setup do > > > > > > @errors = mock("errors") > > > > > > @errors.stub!(:count).and_return(0) > > > > > > > > > > > > @user = mock_user > > > > > > @user.stub!(:errors).and_return @errors > > > > > > assigns[:user] = @user > > > > > > end > > > > > > > > > > > > specify "should render new form" do > > > > > > render "/users/new.rhtml" > > > > > > response.should_have_tag ''form'', :attributes =>{:action => > > > > users_path, > > > > > > :method => ''post''} > > > > > > > > > > > > end > > > > > > end > > > > > > > > > > > > Can anyone think of why "render" is protected? Is this a > versioning > > > > issue? > > > > > > > > > > It''s protected in ActionController::Base in rails >= 1.2.3(perhaps > > > > > before), so Spec::Rails made it protected as well. > > > > > > > > > > You mentioned that you''ve got zentest installed - what does that > have > > > > > to do with this problem? RSpec''s dependency on ZenTest has been > gone > > > > > for quite some time now. Are you running specs w/ autotest or > > > > > rspec_autotest? > > > > > > > > > > > > > > > > > > > > > > Thanks - Jeff > > > > > > > > > > > > _______________________________________________ > > > > > > rspec-users mailing list > > > > > > rspec-users at rubyforge.org > > > > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > > > > > > _______________________________________________ > > > > > rspec-users mailing list > > > > > rspec-users at rubyforge.org > > > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > > > > > > > > > > > > _______________________________________________ > > > > rspec-users mailing list > > > > rspec-users at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070419/fbb94b4e/attachment-0001.html
David Chelimsky
2007-Apr-19 19:04 UTC
[rspec-users] View Specs Fail with "protected method render"
On 4/19/07, Jeff Dean <jeff at jefdean.com> wrote:> Are you planning an major breaking changes in edge spec soon? I have to > figure out if I want to go edge/edge or stable/stable, and if there aren''t > any huge feature changes coming down the line I think I''ll go with edge.Well, edge rspec breaks compatibility w/ all of the pre 0.9 "should_xxx" methods (http://rspec.rubyforge.org/upgrade.html), but it comes w/ a translator to convert your existing specs which gets most of it right (we''re not looking for 100% - just close). So moving to edge won''t be completely pain free if you''re still using should_render, etc. Also - there are some more changes afoot in terms of using "before(:all)" instead of "context_setup", but we''re not yanking the old names in these cases, so this stuff won''t break what you have. You also do get a ton of benefits from 0.9 (http://www.nabble.com/ANN:-RSpec-0.9.0-beta-1-available-for-download.-t3526972.html). Let me know if you have any other questions. David> > > On 4/19/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > On 4/19/07, Jeff Dean <jeff at jefdean.com> wrote: > > > Thanks for all of your help on this. By the way - is there a donate > link > > > anywhere? > > > > > > Here''s the result of spec spec/views/users/show_rhtml > > > _spec.rb -b > > > NoMethodError in ''/users/show.rhtml should render attributes in <p>'' > > > protected method `render'' called for > > > #<Spec::Rails::Runner::ViewSpecController:0x31388d4> > > > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/expectations/sugar.rb:14:in > > > `call'' > > > /usr/local/lib/ruby/gems/1.8/gems/rspec- > > > 0.8.2/lib/spec/expectations/sugar.rb:14:in > > > `_method_missing'' > > > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/expectations/sugar.rb:10:in > > > `method_missing'' > > > > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > > > `render'' > > > ./spec/views/users/show_rhtml_spec.rb:13: > > > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/specification.rb:66:in > > > `instance_eval'' > > > /usr/local/lib/ruby/gems/1.8/gems/rspec- > 0.8.2/lib/spec/runner/specification.rb:66:in > > > `execute_spec'' > > > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/specification.rb:31:in > > > `run'' > > > /usr/local/lib/ruby/gems/1.8/gems/rspec- > 0.8.2/lib/spec/runner/context.rb:37:in > > > `run'' > > > /usr/local/lib/ruby/gems/1.8/gems/rspec- > > > 0.8.2/lib/spec/runner/context.rb:34:in `each'' > > > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context.rb:34:in > > > `run'' > > > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context_runner.rb:21:in > > > `run'' > > > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context_runner.rb:20:in > > > `each'' > > > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib/spec/runner/context_runner.rb:20:in > > > `run'' > > > /usr/local/lib/ruby/gems/1.8/gems/rspec- > > > 0.8.2/lib/spec/runner/command_line.rb:29:in `run'' > > > > /usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/bin/spec:4: > > > /usr/local/bin/spec:18:in `load'' > > > /usr/local/bin/spec:18: > > > > Well, I''m not sure why there is a conflict between rspec 0.8.2 and > > edge rails, but there is apparently. I tried this w/ rails 1.2.3 and > > also using edge rails/edge rspec - in both cases there was no problem. > > I guess if you''re using edge rails you should probably be using edge > > rspec too. > > > > > > > > > > > > > > > On 4/19/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > > > On 4/19/07, Jeff Dean < jeff at jefdean.com> wrote: > > > > > I run the view specs with rake spec:views. I mentioned zentest only > > > because > > > > > I wasn''t sure if it affected the specs in any way. > > > > > > > > > > If render is protected, how should I be writing my view specs? > > > > > > > > #render is protected on the controller - not within your spec - so > saying > > > ... > > > > > > > > it "should render new form" do > > > > render "/users/new.rhtml" > > > > ... > > > > end > > > > > > > > ... is fine. > > > > > > > > I think the message about render is a red herring. I''m not sure what > > > > the real problem is from the info we''ve got so far. Would you mind > > > > doing this: > > > > > > > > spec spec/views/users/show_rhtml_spec.rb -b > > > > > > > > If you are using rspec installed as a plugin then do this: > > > > > > > > vendor/rspec/bin/spec > spec/views/users/show_rhtml_spec.rb > > > -b > > > > > > > > That will provide the full backtrace info which might help diagnose > this. > > > > > > > > Thanks, > > > > David > > > > > > > > > > > > > > > > > > > On 4/19/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > > > > > > > > > On 4/10/07, Jeff Dean < jeff at jefdean.com> wrote: > > > > > > > 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 > > > > > > > > > > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc> > > > > > > > > > > > > > > > > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > > > > > > > `render'' > > > > > > > ./spec/views/users/show_rhtml_spec.rb:13: > > > > > > > > > > > > > > Note the "protected method `render'' called for > > > > > > > > > > #<Spec::Rails::Runner::ViewSpecController:0x3197dfc>" > > > > > > > > > > > > > > Here''s an example spec: > > > > > > > > > > > > > > require File.dirname(__FILE__) + ''/../../spec_helper'' > > > > > > > > > > > > > > context "/users/new.rhtml" do > > > > > > > include UsersHelper > > > > > > > > > > > > > > setup do > > > > > > > @errors = mock("errors") > > > > > > > @errors.stub!(:count).and_return(0) > > > > > > > > > > > > > > @user = mock_user > > > > > > > @user.stub!(:errors).and_return @errors > > > > > > > assigns[:user] = @user > > > > > > > end > > > > > > > > > > > > > > specify "should render new form" do > > > > > > > render "/users/new.rhtml" > > > > > > > response.should_have_tag ''form'', :attributes =>{:action => > > > > > users_path, > > > > > > > :method => ''post''} > > > > > > > > > > > > > > end > > > > > > > end > > > > > > > > > > > > > > Can anyone think of why "render" is protected? Is this a > versioning > > > > > issue? > > > > > > > > > > > > It''s protected in ActionController::Base in rails >= 1.2.3 > (perhaps > > > > > > before), so Spec::Rails made it protected as well. > > > > > > > > > > > > You mentioned that you''ve got zentest installed - what does that > have > > > > > > to do with this problem? RSpec''s dependency on ZenTest has been > gone > > > > > > for quite some time now. Are you running specs w/ autotest or > > > > > > rspec_autotest? > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks - Jeff > > > > > > > > > > > > > > _______________________________________________ > > > > > > > rspec-users mailing list > > > > > > > rspec-users at rubyforge.org > > > > > > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > > > > > > > > _______________________________________________ > > > > > > rspec-users mailing list > > > > > > rspec-users at rubyforge.org > > > > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > rspec-users mailing list > > > > > rspec-users at rubyforge.org > > > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > > > > _______________________________________________ > > > > rspec-users mailing list > > > > rspec-users at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > > > > > > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Daniel Manges
2007-Apr-20 05:18 UTC
[rspec-users] View Specs Fail with "protected method render"
I think this was fixed in r1594: http://rubyforge.org/tracker/index.php?func=detail&aid=9232&group_id=797&atid=3151 Dan Manges On 4/18/07, Jeff Dean <jeff at jefdean.com> wrote:> > > zentest -v = zentest v3.4.3 > spec -v = RSpec-0.8.2 (r1560) - BDD for Ruby > spec_on_rails is a checkout of REL_0_8_2 > > > aslak hellesoy wrote: > > > > On 4/11/07, Jeff Dean <jeff at jefdean.com> wrote: > >> 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 > >> #<Spec::Rails::Runner::ViewSpecController:0x3197dfc> > >> > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > >> `render'' > >> ./spec/views/users/show_rhtml_spec.rb:13: > >> > >> Note the "protected method `render'' called for > >> #<Spec::Rails::Runner::ViewSpecController:0x3197dfc>" > >> > >> Here''s an example spec: > >> > >> require File.dirname(__FILE__) + ''/../../spec_helper'' > >> > >> context "/users/new.rhtml" do > >> include UsersHelper > >> > >> setup do > >> @errors = mock("errors") > >> @errors.stub!(:count).and_return(0) > >> > >> @user = mock_user > >> @user.stub!(:errors).and_return @errors > >> assigns[:user] = @user > >> end > >> > >> specify "should render new form" do > >> render "/users/new.rhtml" > >> response.should_have_tag ''form'', :attributes =>{:action => > >> users_path, > >> :method => ''post''} > >> > >> end > >> end > >> > >> Can anyone think of why "render" is protected? Is this a versioning > >> issue? > >> > > > > What versions of everything do you have? > > > > > > -- > View this message in context: > http://www.nabble.com/View-Specs-Fail-with-%22protected-method-render%22-tf3566514.html#a10066654 > Sent from the rspec-users mailing list archive at Nabble.com. > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070420/13bf9071/attachment.html
Jeff Dean
2007-Apr-20 05:56 UTC
[rspec-users] View Specs Fail with "protected method render"
Thanks dan - I''ll check out to at least that revision and see what I get. On 4/20/07, Daniel Manges <daniel.manges at gmail.com> wrote:> > I think this was fixed in r1594: http://rubyforge.org/tracker/index.php?func=detail&aid=9232&group_id=797&atid=3151 > > > Dan Manges > > > On 4/18/07, Jeff Dean <jeff at jefdean.com> wrote: > > > > > > zentest -v = zentest v3.4.3 > > spec -v = RSpec-0.8.2 (r1560) - BDD for Ruby > > spec_on_rails is a checkout of REL_0_8_2 > > > > > > aslak hellesoy wrote: > > > > > > On 4/11/07, Jeff Dean < jeff at jefdean.com> wrote: > > >> 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 > > >> #<Spec::Rails::Runner::ViewSpecController:0x3197dfc> > > >> > > /Users/jeff/Sites/niche/trunk/vendor/plugins/rspec_on_rails/lib/spec/rails/runner/context/view.rb:102:in > > >> `render'' > > >> ./spec/views/users/show_rhtml_spec.rb:13: > > >> > > >> Note the "protected method `render'' called for > > >> #<Spec::Rails::Runner::ViewSpecController:0x3197dfc>" > > >> > > >> Here''s an example spec: > > >> > > >> require File.dirname(__FILE__) + ''/../../spec_helper'' > > >> > > >> context "/users/new.rhtml" do > > >> include UsersHelper > > >> > > >> setup do > > >> @errors = mock("errors") > > >> @errors.stub!(:count).and_return(0) > > >> > > >> @user = mock_user > > >> @user.stub!(:errors).and_return @errors > > >> assigns[:user] = @user > > >> end > > >> > > >> specify "should render new form" do > > >> render "/users/new.rhtml" > > >> response.should_have_tag ''form'', :attributes =>{:action => > > >> users_path, > > >> :method => ''post''} > > >> > > >> end > > >> end > > >> > > >> Can anyone think of why "render" is protected? Is this a versioning > > >> issue? > > >> > > > > > > What versions of everything do you have? > > > > > > > > > > -- > > View this message in context: > > http://www.nabble.com/View-Specs-Fail-with-%22protected-method-render%22-tf3566514.html#a10066654 > > Sent from the rspec-users mailing list archive at Nabble.com. > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070420/df5d1ddc/attachment-0001.html