Add test case for checking _perishable_token, it should be unset after password reset. #951

This commit is contained in:
Carmen
2016-03-23 17:27:44 +08:00
parent 120c6feb61
commit 603bf97c0b

View File

@@ -573,7 +573,15 @@ describe("Password Reset", () => {
expect(response.body).toEqual('Found. Redirecting to http://localhost:8378/1/apps/password_reset_success.html');
Parse.User.logIn("zxcv", "hello").then(function(user){
done();
let config = new Config('test');
config.database.adaptiveCollection('_User')
.then(coll => coll.find({ 'username': 'zxcv' }, { limit: 1 }))
.then((results) => {
// _perishable_token should be unset after reset password
expect(results.length).toEqual(1);
expect(results[0]['_perishable_token']).toEqual(undefined);
done();
});
}, (err) => {
console.error(err);
fail("should login with new password");