wshaver/mongoose-when — pull request #2 by vadimrostok (2014-08-30 21:25:32+00:00)
Title: Fix operations on .then's promises: replace deprecated methods

Mongoose methods `addCallback` and `addErrback` are deprecated. Promises created with `new mongoose.Promise()` have aliases for them (`onFulfill` and `onReject`), but the ones returned by `promiseInstance.then` have none. Therefore operating on such a promises with mongoose-when fails with `TypeError: Object # has no method 'addCallback'`. So updated methods and created a unit test for this case.