Skip to content

Commit

Permalink
Add test case for checking _perishable_token, it should be unset afte…
Browse files Browse the repository at this point in the history
…r password reset. #951
  • Loading branch information
carmenlau committed Mar 23, 2016
1 parent 9edaf98 commit 271de12
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spec/ValidationAndPasswordsReset.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 271de12

Please sign in to comment.