Merge pull request #863 from ParsePlatform/fosco.authData2
Test empty authData block on login for #413
This commit is contained in:
@@ -1012,4 +1012,32 @@ describe('miscellaneous', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('android login providing empty authData block works', (done) => {
|
||||
let headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Parse-Application-Id': 'test',
|
||||
'X-Parse-REST-API-Key': 'rest'
|
||||
};
|
||||
let data = {
|
||||
username: 'pulse1989',
|
||||
password: 'password1234',
|
||||
authData: {}
|
||||
};
|
||||
let requestOptions = {
|
||||
headers: headers,
|
||||
url: 'http://localhost:8378/1/users',
|
||||
body: JSON.stringify(data)
|
||||
};
|
||||
request.post(requestOptions, (error, response, body) => {
|
||||
expect(error).toBe(null);
|
||||
requestOptions.url = 'http://localhost:8378/1/login';
|
||||
request.get(requestOptions, (error, response, body) => {
|
||||
expect(error).toBe(null);
|
||||
let b = JSON.parse(body);
|
||||
expect(typeof b['sessionToken']).toEqual('string');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user