<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<br><div><div>On Jul 9, 2007, at 5:00 PM, Daniel N wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">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;">  it "should find all users" do<br>    User.should_receive(:find).with( :all, :limit =&gt; 10 ).and_return([@user]) <br>    do_get<br>  end</blockquote></div></blockquote><br></div><div>Sorry for piggybacking on your post, but since you've apparantly figured out your isssue I have a slightly similar question; sometimes I have (in ActiveRecord) a verbose #find I want to mock out using should_receive, maybe looking something along this:</div><div>Foo.find(:all, :select =&gt; "foos.*, bars.*, :joins =&gt; "join bazzers on foos.baz_id = ..", :conditions =&gt; "quux = 1", etc etc)</div><div>... But all I really may care about with a specific mock expectation is that it gets the right :conditions key in the passed-in hash. </div><div><br class="webkit-block-placeholder"></div><div>Is there a way in RSpec to check for a specific hash key (or evaluating other things along those lines) in the parameter expectation using the should_receive(:find).with(...) construct?</div><div><br class="webkit-block-placeholder"></div><div>JS</div><div><br class="webkit-block-placeholder"></div></body></html>