Skip to content

Commit ebbda59

Browse files
committed
Add test case for checking _perishable_token, it should be unset after password reset. #951
1 parent 54f754a commit ebbda59

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

spec/ValidationAndPasswordsReset.spec.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,15 @@ describe("Password Reset", () => {
573573
expect(response.body).toEqual('Found. Redirecting to http://localhost:8378/1/apps/password_reset_success.html');
574574

575575
Parse.User.logIn("zxcv", "hello").then(function(user){
576-
done();
576+
let config = new Config('test');
577+
config.database.adaptiveCollection('_User')
578+
.then(coll => coll.find({ 'username': 'zxcv' }, { limit: 1 }))
579+
.then((results) => {
580+
// _perishable_token should be unset after reset password
581+
expect(results.length).toEqual(1);
582+
expect(results[0]['_perishable_token']).toEqual(undefined);
583+
done();
584+
});
577585
}, (err) => {
578586
console.error(err);
579587
fail("should login with new password");

0 commit comments

Comments
 (0)