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>&nbsp;def update</div><div>&nbsp;&nbsp; &nbsp;...</div><div>&nbsp;&nbsp; &nbsp;if @config.update_attributes
( params[:new_config] )</div><div>&nbsp;&nbsp; &nbsp; &nbsp;redirect_to :action =&gt; :index</div><div>&nbsp;&nbsp; &nbsp;else</div><div>&nbsp;&nbsp; &nbsp;<b> &nbsp;render :action =&gt; :edit, :id =&gt; params[:id] &nbsp; &nbsp; &nbsp;# this line here</b></div><div>&nbsp;&nbsp; &nbsp;end</div></div><div>
&nbsp;&nbsp;...</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>&nbsp;&nbsp;it &#39;should render the &quot;edit&quot; config url on an unsuccessful save&#39; do
</div><div>&nbsp;&nbsp; &nbsp;@config.should_receive(:update_attributes).once.and_return(false)</div><div>&nbsp;&nbsp; &nbsp;c<b>ontroller.expect_render( :action =&gt; :edit, :id =&gt; 1 ).once &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp;my prob</b></div><div>&nbsp;&nbsp; &nbsp;do_update</div><div>
&nbsp;&nbsp;end</div><div><br class="webkit-block-placeholder"></div><div>This fails with</div><div><br class="webkit-block-placeholder"></div><div>Mock &#39;expect_render_mock_proxy&#39; expected :render with ({:action=&gt;:edit, :id=&gt;1}) once, but received it 0 times
</div><div><br class="webkit-block-placeholder"></div><div>I have tried</div><div><div>&nbsp;&nbsp; &nbsp;controller.expect_render( :action =&gt; :edit ).once</div><div><div><br>&nbsp;</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>