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? Thanks, Leslie 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] end it "should render list of apples" do template.should_render(:partial => ''apples/apple'') render "/apples/index.rhtml" end end
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? > > Thanks, > Leslie > > 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] > end > > it "should render list of apples" do > template.should_render(:partial => ''apples/apple'')The method is expect_render, not should_render. HTH, David> render "/apples/index.rhtml" > end > end > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Ack. The devil is in typing errors. I had been trying expets_render (with an s), don''t know how I got should_render in here. At any rate, expect_render does work. Sorry for the lame question, thanks for the quick reply. :) Leslie On Sep 8, 2007, at 2:11 PM, David Chelimsky wrote:> 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? >> >> Thanks, >> Leslie >> >> 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] >> end >> >> it "should render list of apples" do >> template.should_render(:partial => ''apples/apple'') > > The method is expect_render, not should_render. > > HTH, > David > > >> render "/apples/index.rhtml" >> end >> end >> _______________________________________________ >> 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
On 9/8/07, Leslie Freeman <leslief at sunquake.net> wrote:> Ack. The devil is in typing errors. I had been trying expets_render > (with an s), don''t know how I got should_render in here. At any rate, > expect_render does work. Sorry for the lame question, thanks for the > quick reply. :)Glad to help. Cheers, David> > Leslie > > > On Sep 8, 2007, at 2:11 PM, David Chelimsky wrote: > > > 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? > >> > >> Thanks, > >> Leslie > >> > >> 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] > >> end > >> > >> it "should render list of apples" do > >> template.should_render(:partial => ''apples/apple'') > > > > The method is expect_render, not should_render. > > > > HTH, > > David > > > > > >> render "/apples/index.rhtml" > >> end > >> end > >> _______________________________________________ > >> 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 >