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

@ -81,8 +81,6 @@ describe PasswordResetsController, type: :controller do
context "valid user" do
it "reloads page with notice if password is empty" do
token = "reset_token"
allow(controller).to receive(:valid_user).and_return(nil)
allow(controller).to receive(:check_expiration).and_return(nil)
params = {
@ -99,7 +97,6 @@ describe PasswordResetsController, type: :controller do
it "reloads page with notice if password is confirmation doesn't match" do
token = "reset_token"
allow(controller).to receive(:valid_user).and_return(nil)
allow(controller).to receive(:check_expiration).and_return(nil)
params = {
@ -116,14 +113,12 @@ describe PasswordResetsController, type: :controller do
it "updates attributes if the password update is a success" do
user = create(:user, provider: "greenlight")
user.create_reset_digest
old_digest = user.password_digest
allow(controller).to receive(:valid_user).and_return(nil)
allow(controller).to receive(:check_expiration).and_return(nil)
params = {
id: user.reset_token,
id: user.create_reset_digest,
user: {
password: :password,
password_confirmation: :password,