GRN2-xx: Restructured email verification and password reset (#1444)

* Restructured email verification and password reset

* Fixed issue with password reset

Co-authored-by: Jesus Federico <jesus@123it.ca>
This commit is contained in:
Ahmad Farhat
2020-04-29 17:56:46 -04:00
committed by GitHub
parent 8f3ba8a038
commit 28302107bd
10 changed files with 46 additions and 81 deletions

View File

@ -138,8 +138,13 @@ describe User, type: :model do
it 'creates token and respective reset digest' do
user = create(:user)
reset_digest_success = user.create_reset_digest
expect(reset_digest_success).to eq(true)
expect(user.create_reset_digest).to be_truthy
end
it 'correctly verifies the token' do
user = create(:user)
token = user.create_reset_digest
expect(User.exists?(reset_digest: User.hash_token(token))).to be true
end
it 'verifies if password reset link expired' do