Skip to content

Commit 2d4c08c

Browse files
committed
Test empty authData block on login for #413
1 parent b3a52fb commit 2d4c08c

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
@@ -995,4 +995,32 @@ describe('miscellaneous', function() {
995995
});
996996
});
997997

998+
it('android login providing empty authData block works', (done) => {
999+
let headers = {
1000+
'Content-Type': 'application/json',
1001+
'X-Parse-Application-Id': 'test',
1002+
'X-Parse-REST-API-Key': 'rest'
1003+
};
1004+
let data = {
1005+
username: 'pulse1989',
1006+
password: 'password1234',
1007+
authData: {}
1008+
};
1009+
let requestOptions = {
1010+
headers: headers,
1011+
url: 'http://localhost:8378/1/users',
1012+
body: JSON.stringify(data)
1013+
};
1014+
request.post(requestOptions, (error, response, body) => {
1015+
expect(error).toBe(null);
1016+
requestOptions.url = 'http://localhost:8378/1/login';
1017+
request.get(requestOptions, (error, response, body) => {
1018+
expect(error).toBe(null);
1019+
let b = JSON.parse(body);
1020+
expect(typeof b['sessionToken']).toEqual('string');
1021+
done();
1022+
});
1023+
});
1024+
});
1025+
9981026
});

0 commit comments

Comments
 (0)