Chris Habgood
2011-May-24 20:25 UTC
[rspec-users] [rails] expecting <"edit"> but rendering with <"">.
I keep getting "" returned when looking for a template: describe "edit action" do it "edit action should render edit template" do Food.stub(:find_by_id).and_return(food) response.should render_template(:edit) end end -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110524/ec91f1bf/attachment.html>
Justin Ko
2011-May-25 00:05 UTC
[rspec-users] [rails] expecting <"edit"> but rendering with <"">.
On Tue, May 24, 2011 at 2:25 PM, Chris Habgood <chabgood at gmail.com> wrote:> I keep getting "" returned when looking for a template: > > describe "edit action" do > it "edit action should render edit template" do > Food.stub(:find_by_id).and_return(food) > response.should render_template(:edit) > end > end > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >Try adding "render_views": http://relishapp.com/rspec/rspec-rails/v/2-6/dir/controller-specs/render-views -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110524/248a0c67/attachment.html>
Chris Habgood
2011-May-25 00:10 UTC
[rspec-users] [rails] expecting <"edit"> but rendering with <"">.
It is already there. On Tue, May 24, 2011 at 19:05, Justin Ko <jko170 at gmail.com> wrote:> > > On Tue, May 24, 2011 at 2:25 PM, Chris Habgood <chabgood at gmail.com> wrote: > >> I keep getting "" returned when looking for a template: >> >> describe "edit action" do >> it "edit action should render edit template" do >> Food.stub(:find_by_id).and_return(food) >> response.should render_template(:edit) >> end >> end >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > > Try adding "render_views": > http://relishapp.com/rspec/rspec-rails/v/2-6/dir/controller-specs/render-views > > -- > You received this message because you are subscribed to the Google Groups > "rspec" group. > To post to this group, send email to rspec at googlegroups.com. > To unsubscribe from this group, send email to > rspec+unsubscribe at googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rspec?hl=en. >-- *"In matters of style, swim with the current; in matters of principle, stand like a rock." Thomas Jefferson * -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110524/0bd31241/attachment.html>
David Chelimsky
2011-May-25 00:11 UTC
[rspec-users] [rails] expecting <"edit"> but rendering with <"">.
On May 24, 2011, at 7:05 PM, Justin Ko wrote:> On Tue, May 24, 2011 at 2:25 PM, Chris Habgood <chabgood at gmail.com> wrote: > I keep getting "" returned when looking for a template: > > describe "edit action" do > it "edit action should render edit template" do > Food.stub(:find_by_id).and_return(food) > response.should render_template(:edit) > end > end > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > > Try adding "render_views": http://relishapp.com/rspec/rspec-rails/v/2-6/dir/controller-specs/render-viewsAlso - for context - check out http://relishapp.com/rspec/rspec-rails/v/2-6/dir/controller-specs/views-are-stubbed-by-default Cheers, David -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110524/b716015b/attachment.html>
Justin Ko
2011-May-25 00:21 UTC
[rspec-users] [rails] expecting <"edit"> but rendering with <"">.
On Tue, May 24, 2011 at 6:10 PM, Chris Habgood <chabgood at gmail.com> wrote:> It is already there. > > On Tue, May 24, 2011 at 19:05, Justin Ko <jko170 at gmail.com> wrote: > >> >> >> On Tue, May 24, 2011 at 2:25 PM, Chris Habgood <chabgood at gmail.com>wrote: >> >>> I keep getting "" returned when looking for a template: >>> >>> describe "edit action" do >>> it "edit action should render edit template" do >>> Food.stub(:find_by_id).and_return(food) >>> response.should render_template(:edit) >>> end >>> end >>> >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >>> >> >> Try adding "render_views": >> http://relishapp.com/rspec/rspec-rails/v/2-6/dir/controller-specs/render-views >> >> -- >> You received this message because you are subscribed to the Google Groups >> "rspec" group. >> To post to this group, send email to rspec at googlegroups.com. >> To unsubscribe from this group, send email to >> rspec+unsubscribe at googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/rspec?hl=en. >> > > > > -- > *"In matters of style, swim with the current; in matters of principle, > stand like a rock." > Thomas Jefferson > * > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >And it works as expected in dev mode (using the browser)? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110524/68623196/attachment-0001.html>
Chris Habgood
2011-May-25 00:38 UTC
[rspec-users] [rails] expecting <"edit"> but rendering with <"">.
no. On Tue, May 24, 2011 at 19:21, Justin Ko <jko170 at gmail.com> wrote:> > > On Tue, May 24, 2011 at 6:10 PM, Chris Habgood <chabgood at gmail.com> wrote: > >> It is already there. >> >> On Tue, May 24, 2011 at 19:05, Justin Ko <jko170 at gmail.com> wrote: >> >>> >>> >>> On Tue, May 24, 2011 at 2:25 PM, Chris Habgood <chabgood at gmail.com>wrote: >>> >>>> I keep getting "" returned when looking for a template: >>>> >>>> describe "edit action" do >>>> it "edit action should render edit template" do >>>> Food.stub(:find_by_id).and_return(food) >>>> response.should render_template(:edit) >>>> end >>>> end >>>> >>>> _______________________________________________ >>>> rspec-users mailing list >>>> rspec-users at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/rspec-users >>>> >>> >>> Try adding "render_views": >>> http://relishapp.com/rspec/rspec-rails/v/2-6/dir/controller-specs/render-views >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "rspec" group. >>> To post to this group, send email to rspec at googlegroups.com. >>> To unsubscribe from this group, send email to >>> rspec+unsubscribe at googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/rspec?hl=en. >>> >> >> >> >> -- >> *"In matters of style, swim with the current; in matters of principle, >> stand like a rock." >> Thomas Jefferson >> * >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > > And it works as expected in dev mode (using the browser)? > > -- > You received this message because you are subscribed to the Google Groups > "rspec" group. > To post to this group, send email to rspec at googlegroups.com. > To unsubscribe from this group, send email to > rspec+unsubscribe at googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rspec?hl=en. >-- *"In matters of style, swim with the current; in matters of principle, stand like a rock." Thomas Jefferson * -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110524/6f6cbccf/attachment.html>
Chris Habgood
2011-May-25 00:39 UTC
[rspec-users] [rails] expecting <"edit"> but rendering with <"">.
describe FoodsController do render_views before(:each) do Food.delete_all login_as_admin end describe "stub_model(Food) with a hash of stubs" do let(:food) do stub_model Food end describe "edit action" do it "edit action should render edit template" do #Food.stub(:find_by_id).and_return(food) Food.any_instance.stubs(:valid?).returns(true) response.should render_template(:edit) end end On Tue, May 24, 2011 at 19:38, Chris Habgood <chabgood at gmail.com> wrote:> no. > > > On Tue, May 24, 2011 at 19:21, Justin Ko <jko170 at gmail.com> wrote: > >> >> >> On Tue, May 24, 2011 at 6:10 PM, Chris Habgood <chabgood at gmail.com>wrote: >> >>> It is already there. >>> >>> On Tue, May 24, 2011 at 19:05, Justin Ko <jko170 at gmail.com> wrote: >>> >>>> >>>> >>>> On Tue, May 24, 2011 at 2:25 PM, Chris Habgood <chabgood at gmail.com>wrote: >>>> >>>>> I keep getting "" returned when looking for a template: >>>>> >>>>> describe "edit action" do >>>>> it "edit action should render edit template" do >>>>> Food.stub(:find_by_id).and_return(food) >>>>> response.should render_template(:edit) >>>>> end >>>>> end >>>>> >>>>> _______________________________________________ >>>>> rspec-users mailing list >>>>> rspec-users at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/rspec-users >>>>> >>>> >>>> Try adding "render_views": >>>> http://relishapp.com/rspec/rspec-rails/v/2-6/dir/controller-specs/render-views >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "rspec" group. >>>> To post to this group, send email to rspec at googlegroups.com. >>>> To unsubscribe from this group, send email to >>>> rspec+unsubscribe at googlegroups.com. >>>> For more options, visit this group at >>>> http://groups.google.com/group/rspec?hl=en. >>>> >>> >>> >>> >>> -- >>> *"In matters of style, swim with the current; in matters of principle, >>> stand like a rock." >>> Thomas Jefferson >>> * >>> >>> _______________________________________________ >>> rspec-users mailing list >>> rspec-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >>> >> >> And it works as expected in dev mode (using the browser)? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "rspec" group. >> To post to this group, send email to rspec at googlegroups.com. >> To unsubscribe from this group, send email to >> rspec+unsubscribe at googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/rspec?hl=en. >> > > > > -- > *"In matters of style, swim with the current; in matters of principle, > stand like a rock." > Thomas Jefferson > * >-- *"In matters of style, swim with the current; in matters of principle, stand like a rock." Thomas Jefferson * -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110524/2eadd0b7/attachment.html>
Justin Ko
2011-May-25 01:07 UTC
[rspec-users] [rails] expecting <"edit"> but rendering with <"">.
Looks like you''re not invoking the action: get :edit, :id => ... Sent from my iPhone On May 24, 2011, at 6:39 PM, Chris Habgood <chabgood at gmail.com> wrote:> describe FoodsController do > render_views > > before(:each) do > Food.delete_all > login_as_admin > end > > describe "stub_model(Food) with a hash of stubs" do > let(:food) do > stub_model Food > end > > describe "edit action" do > it "edit action should render edit template" do > #Food.stub(:find_by_id).and_return(food) > Food.any_instance.stubs(:valid?).returns(true) > response.should render_template(:edit) > end > end > > > On Tue, May 24, 2011 at 19:38, Chris Habgood <chabgood at gmail.com> wrote: > no. > > > On Tue, May 24, 2011 at 19:21, Justin Ko <jko170 at gmail.com> wrote: > > > On Tue, May 24, 2011 at 6:10 PM, Chris Habgood <chabgood at gmail.com> wrote: > It is already there. > > On Tue, May 24, 2011 at 19:05, Justin Ko <jko170 at gmail.com> wrote: > > > On Tue, May 24, 2011 at 2:25 PM, Chris Habgood <chabgood at gmail.com> wrote: > I keep getting "" returned when looking for a template: > > describe "edit action" do > it "edit action should render edit template" do > Food.stub(:find_by_id).and_return(food) > response.should render_template(:edit) > end > end > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > > Try adding "render_views": http://relishapp.com/rspec/rspec-rails/v/2-6/dir/controller-specs/render-views > -- > You received this message because you are subscribed to the Google Groups "rspec" group. > To post to this group, send email to rspec at googlegroups.com. > To unsubscribe from this group, send email to rspec+unsubscribe at googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rspec?hl=en. > > > > -- > "In matters of style, swim with the current; in matters of principle, stand like a rock." > Thomas Jefferson > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > > And it works as expected in dev mode (using the browser)? > -- > You received this message because you are subscribed to the Google Groups "rspec" group. > To post to this group, send email to rspec at googlegroups.com. > To unsubscribe from this group, send email to rspec+unsubscribe at googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rspec?hl=en. > > > > -- > "In matters of style, swim with the current; in matters of principle, stand like a rock." > Thomas Jefferson > > > > > -- > "In matters of style, swim with the current; in matters of principle, stand like a rock." > Thomas Jefferson > > _______________________________________________ > 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/20110524/41c2df28/attachment-0001.html>