Skip to content

Commit

Permalink
adds test for issue #1031
Browse files Browse the repository at this point in the history
  • Loading branch information
flovilmart committed Mar 17, 2016
1 parent e1c4755 commit ae0dffb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/ParseAPI.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
var appId;
Parse._request('POST', 'rest_create_app').then((res) => {
Expand Down
7 changes: 7 additions & 0 deletions spec/cloud/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,10 @@ Parse.Cloud.define('echoKeys', function(req, res){
javascriptKey: Parse.javascriptKey
})
});

Parse.Cloud.define('createBeforeSaveChangedObject', function(req, res){
let obj = new Parse.Object('BeforeSaveChanged');
obj.save().then(() => {
res.success(obj);
})
})

0 comments on commit ae0dffb

Please sign in to comment.