My Bad... Please ignore<br><br><div><span class="gmail_quote">On 7/10/07, <b class="gmail_sendername">Daniel N</b> &lt;<a href="mailto:has.sox@gmail.com">has.sox@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I&#39;m trying to setup a mock for my controller test but I can&#39;t get it to recognise the mock.<br><br>I use<br><br>&nbsp; it &quot;should find all users&quot; do<br>&nbsp;&nbsp;&nbsp; User.should_receive(:find).with( :all, :limit =&gt; 10 ).and_return([@user])
<br>&nbsp;&nbsp;&nbsp; do_get<br>&nbsp; end<br><br>and in the controller<br>@users = User.find(:all, :limit =&gt; 10 )<br><br>But this does not work.&nbsp; It gives me <br>User expected :find with (:all) once, but received it 0 times<br><br>If I remove the :limit from the controller
<br>@users = User.find(:all)<br><br>I get<br>User expected :find with (:all, {:limit=&gt;10}) once, but received it 0 times<br><br>How do I spec mocks with options passed to them?<br><br>Cheers<br><span class="sg">Daniel
<br>
</span></blockquote></div><br>