Skip to content

Commit

Permalink
Merge pull request #863 from ParsePlatform/fosco.authData2
Browse files Browse the repository at this point in the history
Test empty authData block on login for #413
  • Loading branch information
gfosco committed Mar 6, 2016
2 parents 157e43f + 2d4c08c commit e92ee7e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions spec/ParseAPI.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
});

});

0 comments on commit e92ee7e

Please sign in to comment.