Skip to content

Commit

Permalink
Adds tests for repro #2090
Browse files Browse the repository at this point in the history
  • Loading branch information
flovilmart committed Jul 22, 2016
1 parent 66c4b98 commit eca0e7d
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions spec/ParseInstallation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,52 @@ describe('Installations', () => {
});
});

it('allows empty installation save with x-parse-installation-id header (regression #2090)', (done) => {
let installationId = '12345678-abcd-abcd-abcd-123456789abc';
let device = 'android';
let input = {};
let reqAuth = new auth.Auth({ config, isMaster: true, installationId });
rest.create(config, reqAuth, '_Installation', input)
.then(createResult => {
let headers = {
'X-Parse-Application-Id': 'test',
'X-Parse-REST-API-Key': 'rest',
};
request.get({
headers: headers,
url: 'http://localhost:8378/1/installations/' + createResult.response.objectId,
json: true,
}, (error, response, body) => {
expect(body.objectId).toEqual(createResult.response.objectId);
done();
});
})
.catch(error => {
console.log(error);
fail('failed');
done();
});
});

it('allows empty installation save with x-parse-installation-id header with REST (regression #2090)', (done) => {
let installationId = '12345678-abcd-abcd-abcd-123456789abc';
let device = 'android';
let input = {};
let headers = {
'X-Parse-Application-Id': 'test',
'X-Parse-REST-API-Key': 'rest',
'X-Parse-Installation-Id': installationId
};
request.post({
headers: headers,
url: 'http://localhost:8378/1/classes/_Installation',
json: true,
}, (error, response, body) => {
expect(body.objectId).not.toBeUndefined();
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 eca0e7d

Please sign in to comment.