title: Stubbing Chained Methods with Rspec
body: <p>I want to call a named_scope that will only return one record, but the named_scope returns an array, that's not a big deal as I can just chain it with .first:</p>
  
  <pre><code>Model.named_scope(param).first
  </code></pre>
  
  <p>and this works, what I am struggling with is how to stub the chained call. Does anyone have a reference or an answer on how I would go about achieving this with Rspec mocking?</p>