[rspec-users] Testing render :update

Jarl Friis lists at ruby-forum.com
Tue Jul 6 06:54:24 EDT 2010

David Chelimsky wrote:
> 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:
> page = double('page')
> controller.stub(:render)
> controller.stub(:render).with(:update).and_yield(page)
> page.should_receive(:replace_html).with(...)
> 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.

Could it be this ticket:
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list