adds test for issue #1031

This commit is contained in:
Florent Vilmart
2016-03-16 23:59:01 -04:00
parent e1c475512c
commit e270964b4b
2 changed files with 14 additions and 0 deletions

View File

@@ -396,6 +396,13 @@ describe('miscellaneous', function() {
}); });
}); });
it('should properly create an object in before save', (done) => {
Parse.Cloud.run('createBeforeSaveChangedObject').then((res) => {
expect(res.get('foo')).toEqual('baz');
done();
});
})
it('test rest_create_app', function(done) { it('test rest_create_app', function(done) {
var appId; var appId;
Parse._request('POST', 'rest_create_app').then((res) => { Parse._request('POST', 'rest_create_app').then((res) => {

View File

@@ -108,3 +108,10 @@ Parse.Cloud.define('echoKeys', function(req, res){
javascriptKey: Parse.javascriptKey javascriptKey: Parse.javascriptKey
}) })
}); });
Parse.Cloud.define('createBeforeSaveChangedObject', function(req, res){
var obj = new Parse.Object('BeforeSaveChanged');
obj.save().then(() => {
res.success(obj);
})
})