title: Stubbing a Mongoose model with Sinon
body: <p>I want to create a stub for the Mongoose <code>save</code> method in a particular model, so that any instance of my model I create will call the stub instead of the normal Mongoose <code>save</code> method. My understanding is that the only way to do this is to stub the entire model like this:</p>
  
  <pre><code>var stub = sinon.stub(myModel.prototype);
  </code></pre>
  
  <p>Unfortunately, this line of code causes my tests to throw the following error:</p>
  
  <pre><code>TypeError: Cannot read property 'states' of undefined
  </code></pre>
  
  <p>Does anyone know what is going wrong here?</p>