<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:38 PM, Josh Knowles wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><span class="gmail_quote">On 7/9/07, <b class="gmail_sendername">Johan Sørensen</b> <<a href="mailto:johan@johansorensen.com">johan@johansorensen.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;"> <div style=""> <br><div><br></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> </blockquote><div><br><br>As opposed to getting into complicated mocking scenarios, consider abstracting this logic into your model: <a href="http://blog.caboo.se/articles/2007/6/19/rspec-notes-from-the-trenches-2">http://blog.caboo.se/articles/2007/6/19/rspec-notes-from-the-trenches-2 </a><br></div></div></blockquote></div><br><div><br class="webkit-block-placeholder"></div><div>Well, that's where it is, and for various reasons writing to the database is something I'm avoiding as long as I can (speedy tests and complex fk constraints being a few of them). I'm still not convinced that it's a good idea to do that for model specs, but that's another topic ;)</div><div><br class="webkit-block-placeholder"></div><div>JS</div></body></html>