Skip to content

Commit e92ee7e

Browse files
committed
Merge pull request #863 from ParsePlatform/fosco.authData2
Test empty authData block on login for #413
2 parents 157e43f + 2d4c08c commit e92ee7e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

spec/ParseAPI.spec.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,4 +1012,32 @@ describe('miscellaneous', function() {
10121012
});
10131013
});
10141014

1015+
it('android login providing empty authData block works', (done) => {
1016+
let headers = {
1017+
'Content-Type': 'application/json',
1018+
'X-Parse-Application-Id': 'test',
1019+
'X-Parse-REST-API-Key': 'rest'
1020+
};
1021+
let data = {
1022+
username: 'pulse1989',
1023+
password: 'password1234',
1024+
authData: {}
1025+
};
1026+
let requestOptions = {
1027+
headers: headers,
1028+
url: 'http://localhost:8378/1/users',
1029+
body: JSON.stringify(data)
1030+
};
1031+
request.post(requestOptions, (error, response, body) => {
1032+
expect(error).toBe(null);
1033+
requestOptions.url = 'http://localhost:8378/1/login';
1034+
request.get(requestOptions, (error, response, body) => {
1035+
expect(error).toBe(null);
1036+
let b = JSON.parse(body);
1037+
expect(typeof b['sessionToken']).toEqual('string');
1038+
done();
1039+
});
1040+
});
1041+
});
1042+
10151043
});

0 commit comments

Comments
 (0)