Test update

This commit is contained in:
Anatoliy Chakkaev 2013-04-01 20:10:46 +04:00
parent b0a1ed3bed
commit c5019ef354
1 changed files with 14 additions and 0 deletions

View File

@ -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();
});
})
});
});
});
});