Hi,<div><br> </div><div>A controller has a method with the following</div><div><br> </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> </div><div>The example has the following
</div><div><br> </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> </div><div>This fails with</div><div>...</div><div>Mock 'expect_render_mock_proxy' expected :render with ({:action=>:edit, :id=>1}) once, but received it 0 times
</div><div><br> </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> </div><div>Thanks for all and any help!
</div><div><br> </div><div>Cheers!</div><div>sinclair</div></div></div></div>