diff --git a/test/validations.test.js b/test/validations.test.js index 745fa664..dc86182d 100644 --- a/test/validations.test.js +++ b/test/validations.test.js @@ -73,6 +73,20 @@ describe('validations', function() { }); }); + it('should work on update', function(done) { + User.validatesPresenceOf('name'); + User.create({name: 'Valid'}, function(e, d) { + d.updateAttribute('name', null, function(e) { + should.exist(e); + e.should.be.instanceOf(Error); + d.updateAttribute('name', 'Vasiliy', function(e) { + should.not.exist(e); + done(); + }); + }) + }); + }); + }); });