Rob Aldred wrote in post #985198: > On 3 Mar 2011, at 07:36, Jiang Guimin wrote: > >> end >> controller.should_receive(:save_u_and_node).with(table, >> >> rspec-users mailing list >> rspec-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > > Are you wanting to stub a method of the controller you are actually > testing? > I'm pretty sure this is bad practice.
You are right, it's bad practice, i got nightmare because of "save_u_and_node". "save_u_and_node" is a huge code block that was written by my colleagues some months ago, and i need add some features based at "save_u_and_node", but i can't find any spec codes for "save_u_and_node", so i had to stub "save_u_and_node" in controller roughly in order to pass spec. Thanks This forum's email notification featrue seems dosen't work -- Posted via http://www.ruby-forum.com/. _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users