Hi,<div><br class="webkit-block-placeholder"></div><div>A controller has a method with the following</div><div><br class="webkit-block-placeholder"></div><div><div> def update</div><div> ...</div><div> if @config.update_attributes
( params[:new_config] )</div><div> redirect_to :action => :index</div><div> else</div><div> <b> render :action => :edit, :id => params[:id] # this line here</b></div><div> end</div></div><div>
...</div><div>end</div><div><br class="webkit-block-placeholder"></div><div>The example has the following</div><div><br class="webkit-block-placeholder"></div><div><div> it 'should render the "edit" config url on an unsuccessful save' do
</div><div> @config.should_receive(:update_attributes).once.and_return(false)</div><div> c<b>ontroller.expect_render( :action => :edit, :id => 1 ).once # my prob</b></div><div> do_update</div><div>
end</div><div><br class="webkit-block-placeholder"></div><div>This fails with</div><div><br class="webkit-block-placeholder"></div><div>Mock 'expect_render_mock_proxy' expected :render with ({:action=>:edit, :id=>1}) once, but received it 0 times
</div><div><br class="webkit-block-placeholder"></div><div>I have tried</div><div><div> controller.expect_render( :action => :edit ).once</div><div><div><br> </div><div>Am I using #expect_render correctly?</div><div>
<br class="webkit-block-placeholder"></div><div>Thanks for all and any helpv</div><div><br class="webkit-block-placeholder"></div><div>Cheers!</div><div>sinclair</div><div><br class="webkit-block-placeholder"></div></div>
</div></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div>