mccormicka/Mockgoose — pull request #60 by ydaniv (2014-05-04 19:58:09+00:00)
Title: Fixed tests for testing issue #58

Fixed tests to test specifically this issue.

Notice that while connected to mongod, the console logs:
```
background addExistingToIndex exception E11000 duplicate key error index: TestingDB.indexuniquemodels.$name_1 dup key: { : "Vlad Impaler" }
```

Also note what the [Mongoose docs say](http://mongoosejs.com/docs/api.html#schematype_SchemaType-unique) about this error:

> NOTE: violating the constraint returns an E11000 error from MongoDB when saving, not a Mongoose validation error.

So the error is raised anyhow, only it's coming directly from mongo, if it matters (I guess not, but just to be sure).