My Bad... Please ignore<br><br><div><span class="gmail_quote">On 7/10/07, <b class="gmail_sendername">Daniel N</b> <<a href="mailto:has.sox@gmail.com">has.sox@gmail.com</a>> 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'm trying to setup a mock for my controller test but I can't get it to recognise the mock.<br><br>I use<br><br> it "should find all users" do<br> User.should_receive(:find).with( :all, :limit => 10 ).and_return([@user])
<br> do_get<br> end<br><br>and in the controller<br>@users = User.find(:all, :limit => 10 )<br><br>But this does not work. 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=>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>