Merge branch 'wpjunior-fix_update_attributes_error'

This commit is contained in:
Raymond Feng 2015-11-26 09:31:59 -08:00
commit cb776b1354
1 changed files with 12 additions and 0 deletions

View File

@ -606,6 +606,18 @@ describe('manipulation', function () {
.catch(done);
});
it('should raises on connector error', function(done) {
var fakeConnector = {
updateAttributes: function (model, id, data, options, cb) {
cb(new Error('Database Error'));
}
};
person.getConnector = function () { return fakeConnector; };
person.updateAttributes({name: 'John'}, function(err, p) {
should.exist(err);
done();
});
});
});
describe('updateOrCreate', function() {