This project is archived and is in readonly mode.
view test case returns a different object for every call to _view
Reported by David Chelimsky | June 8th, 2010 @ 08:21 PM
test "something on the view that needs a stub" do
_view.stubs(:helper_method).returns("value")
_view.method_that_calls_helper_method
end
This fails because _view returns a new object each time. This should be memoized for the duration of the test.
Patch forthcoming
Comments and changes to this ticket
-
David Chelimsky June 8th, 2010 @ 08:23 PM
- Assigned user set to José Valim
Here's the patch:
http://github.com/dchelimsky/rails/commit/890dd1026302fc6a52bbcd3f9...
-
David Chelimsky June 8th, 2010 @ 08:24 PM
- Assigned user changed from José Valim to Yehuda Katz (wycats)
-
Repository June 8th, 2010 @ 08:26 PM
- State changed from new to resolved
(from [bdcf70cca89df906a3510464ef46a44646fd29a3]) Memoize the object returned by _view in ActionView::TestCase::Behavior
[#4799 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/bdcf70cca89df906a3510464ef46a4...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Referenced by
- 4799 view test case returns a different object for every call to _view [#4799 state:resolved]