Ignore _RevoableSession "header" that is sent by JS SDK. Fixes #1548. (#1627)

This commit is contained in:
Drew
2016-04-25 12:52:21 -07:00
committed by Florent Vilmart
parent 234d0093ff
commit 957b5927b1
4 changed files with 44 additions and 16 deletions

View File

@@ -1299,7 +1299,7 @@ describe('miscellaneous', function() {
});
})
});
it('properly returns incremented values (#1554)', (done) => {
let headers = {
'Content-Type': 'application/json',
@@ -1312,12 +1312,12 @@ describe('miscellaneous', function() {
json: true
};
let object = new Parse.Object('AnObject');;
function runIncrement(amount) {
let options = Object.assign({}, requestOptions, {
body: {
"key": {
__op: 'Increment',
__op: 'Increment',
amount: amount
}
},
@@ -1333,7 +1333,7 @@ describe('miscellaneous', function() {
});
})
}
object.save().then(() => {
return runIncrement(1);
}).then((res) => {
@@ -1345,4 +1345,30 @@ describe('miscellaneous', function() {
})
})
it('ignores _RevocableSession "header" send by JS SDK', (done) => {
let object = new Parse.Object('AnObject');
object.set('a', 'b');
object.save().then(() => {
request.post({
headers: {'Content-Type': 'application/json'},
url: 'http://localhost:8378/1/classes/AnObject',
body: {
_method: 'GET',
_ApplicationId: 'test',
_JavaScriptKey: 'test',
_ClientVersion: 'js1.8.3',
_InstallationId: 'iid',
_RevocableSession: "1",
},
json: true
}, (err, res, body) => {
expect(body.error).toBeUndefined();
expect(body.results).not.toBeUndefined();
expect(body.results.length).toBe(1);
let result = body.results[0];
expect(result.a).toBe('b');
done();
})
});
});
});