We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent adeb9c7 commit c0e69edCopy full SHA for c0e69ed
tests/object.js
@@ -59,6 +59,26 @@ describe('Objects', function(){
59
}
60
})
61
});
62
+
63
+ it('should validate failed.', function(done){
64
+ var TestObject = AV.Object.extend('TestObject', {
65
+ validate: function (attrs, options){
66
+ return new AV.Error(1, "test");
67
+ }
68
+ });
69
+ var testObject =new TestObject();
70
+ testObject.set('a',1, {
71
+ success: function(){
72
+ throw "should not be here.";
73
+ },
74
+ error: function(obj, err){
75
+ console.dir(err);
76
+ expect(obj.get('a')).to.be(undefined);
77
+ expect(err.message).to.be('test');
78
+ done();
79
80
81
82
83
84
0 commit comments