This does not seem to work with rspec-2/rails-3. Don’t know why yet
(won’t be able to look for a bit), but my guess is that something (like
rspec ) is adding render() to the controller even later than this
stub does. I’ll follow up if I learn something.
This does not seem to work with rspec-2/rails-3. Don’t know why yet (won’t be able to look for a bit), but my guess is that something (like rspec ) is adding render() to the controller even later than this stub does. I’ll follow up if I learn something.
Looks like action_pack calls render twice (the 2nd time in
action_controller/metal/implicit_render.rb:10:in `default_render’), so
we’ve got to stub the :render call twice:
Bummer. It seems like this is a rails bug (render should only get called
once, and there is code that prevents it from being called twice, but
not all of the time), but I’m not sure if I can make that case or not.
I’ll try
Looks like action_pack calls render twice (the 2nd time in
action_controller/metal/implicit_render.rb:10:in `default_render’), so
we’ve got to stub the :render call twice:
Bummer. It seems like this is a rails bug (render should only get called
once, and there is code that prevents it from being called twice, but
not all of the time), but I’m not sure if I can make that case or not.
I’ll try
Have this problem been reported to the rails project. I am not using
rspec, but trying to stub away rendering and run into the same
situation; have to call #expects twice using Mocha framework.