Skip to content

Commit

Permalink
Add failing test for updating installations with masterKey
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyPlease committed Oct 19, 2016
1 parent 305b037 commit bfb3457
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/ParseInstallation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,29 @@ describe('Installations', () => {
});
});

it('allows you to update installation with masterKey', done => {
let installId = '12345678-abcd-abcd-abcd-123456789abc';
let device = 'android';
let input = {
'installationId': installId,
'deviceType': device
};
rest.create(config, auth.nobody(config), '_Installation', input)
.then(createResult => {
let installationObj = Parse.Installation.createWithoutData(createResult.response.objectId);
installationObj.set('customField', 'custom value');
return installationObj.save(null, {useMasterKey: true});
}).then(updateResult => {
expect(updateResult).not.toBeUndefined();
expect(updateResult.get('customField')).toEqual('custom value');
done();
}).catch(error => {
console.log(error);
fail('failed');
done();
});
});

// TODO: Look at additional tests from installation_collection_test.go:882
// TODO: Do we need to support _tombstone disabling of installations?
// TODO: Test deletion, badge increments
Expand Down

0 comments on commit bfb3457

Please sign in to comment.