support Relation object saving (#3074)
* support Parse.Relation object save * prevent Relation object from being saved in storage
This commit is contained in:
committed by
Florent Vilmart
parent
e9e6a4764e
commit
4ea455b20a
@@ -56,6 +56,21 @@ describe('SchemaController', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('can validate Relation object', (done) => {
|
||||
config.database.loadSchema().then((schema) => {
|
||||
return schema.validateObject('Stuff', {aRelation: {__type:'Relation',className:'Stuff'}});
|
||||
}).then((schema) => {
|
||||
return schema.validateObject('Stuff', {aRelation: {__type:'Pointer',className:'Stuff'}})
|
||||
.then((schema) => {
|
||||
fail('expected invalidity');
|
||||
done();
|
||||
}, done);
|
||||
}, (err) => {
|
||||
fail(err);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('rejects inconsistent types', (done) => {
|
||||
config.database.loadSchema().then((schema) => {
|
||||
return schema.validateObject('Stuff', {bacon: 7});
|
||||
|
||||
Reference in New Issue
Block a user