diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index cd4c3254e..fde9c356c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -51,7 +51,6 @@ class UsersController < ApplicationController else user = User.create(user_params.merge(org_params).merge(password_params)) if user.persisted? - user.send_reset_password_instructions redirect_to created_user_redirect_path else @resource.errors.add :email, I18n.t("validations.email.taken") diff --git a/spec/features/organisation_spec.rb b/spec/features/organisation_spec.rb index 8350671c9..a88114077 100644 --- a/spec/features/organisation_spec.rb +++ b/spec/features/organisation_spec.rb @@ -7,13 +7,13 @@ RSpec.describe "User Features" do let(:org_id) { organisation.id } let(:set_password_template_id) { User::CONFIRMABLE_TEMPLATE_ID } let(:notify_client) { instance_double(Notifications::Client) } - let(:reset_password_token) { "MCDH5y6Km-U7CFPgAMVS" } + let(:confirmation_token) { "MCDH5y6Km-U7CFPgAMVS" } let(:devise_notify_mailer) { DeviseNotifyMailer.new } before do allow(DeviseNotifyMailer).to receive(:new).and_return(devise_notify_mailer) allow(devise_notify_mailer).to receive(:notify_client).and_return(notify_client) - allow(Devise.token_generator).to receive(:generate).and_return(reset_password_token) + allow(Devise.token_generator).to receive(:generate).and_return(confirmation_token) allow(notify_client).to receive(:send_email).and_return(true) sign_in user end @@ -55,7 +55,7 @@ RSpec.describe "User Features" do name: "New User", email: "new_user@example.com", organisation: organisation.name, - link: "http://localhost:3000/account/password/edit?reset_password_token=#{reset_password_token}", + link: "http://localhost:3000/account/confirmation?confirmation_token=#{confirmation_token}", }, }, )