[rspec-devel] [ rspec-Patches-12682 ] Not correctly aliasing original 'stub!' and 'should_receive' methods for ApplicationController

noreply at rubyforge.org noreply at rubyforge.org
Mon Jul 30 08:26:52 EDT 2007


Patches item #12682, was opened at 2007-07-30 13:53
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3151&aid=12682&group_id=797

Category: rails plugin
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Matthijs Langenberg (mlangenberg)
Assigned to: Nobody (None)
Summary: Not correctly aliasing original 'stub!' and 'should_receive' methods for ApplicationController

Initial Comment:
Revision 2184 disables controller.should_receive(:render) and controller.stub!(:render), and points to the use of expect_render or stub_render instead.

To do this, the original controller's #should_receive and #stub! methods are being aliased, but the aliasing doesn't work like it should.

I've attached a fix for the alias and a spec to check if the methods are being defined. However, there might be a need for a more 'real life' spec using the sample rails application, but that just depends on how long the deprecation message will be visible.

----------------------------------------------------------------------

>Comment By: Matthijs Langenberg (mlangenberg)
Date: 2007-07-30 14:26

Message:
David, I believe the existing implementation defines the
methods on the wrong class. After I updated to r2184 (from
2183) I wasn't able to call controller.should_receive or
controller.stub! anymore. See the following pastie:
http://p.caboo.se/83407

Also a chat at #rspec revealed that someone else had the
very same problem, fixed by using the attached patch.

If you need more information, please ask.

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-07-30 14:17

Message:
Is something broken? What is incorrect about the existing implementation?

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3151&aid=12682&group_id=797


More information about the rspec-devel mailing list