diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index d06e61fcad..2495a5962d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -81,6 +81,7 @@ def update_email bypass_sign_in(@user) if @user == true_user + flash[:success] = "Click the link in your new email to finalize the email transfer" redirect_to edit_users_path end diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb index 00d74cc9e4..0d3e5236f6 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -1,5 +1,3 @@ -

Hello! <%= @email %>!

- -

You can confirm your account email through the link below:

- +

Click here to confirm your email.

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

+

If you weren't expecting this email, please disregard.

diff --git a/spec/requests/all_casa_admins/casa_admins_spec.rb b/spec/requests/all_casa_admins/casa_admins_spec.rb index 4af32e4014..050fa4d35a 100644 --- a/spec/requests/all_casa_admins/casa_admins_spec.rb +++ b/spec/requests/all_casa_admins/casa_admins_spec.rb @@ -74,7 +74,7 @@ expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.first).to be_a(Mail::Message) expect(ActionMailer::Base.deliveries.first.body.encoded) - .to match("You can confirm your account email through the link below:") + .to match("Click here to confirm your email") end it { is_expected.to redirect_to edit_all_casa_admins_casa_org_casa_admin_path(casa_org, casa_admin) } diff --git a/spec/requests/casa_admins_spec.rb b/spec/requests/casa_admins_spec.rb index 348ded29eb..ec2bd5b123 100644 --- a/spec/requests/casa_admins_spec.rb +++ b/spec/requests/casa_admins_spec.rb @@ -106,7 +106,7 @@ expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.first).to be_a(Mail::Message) expect(ActionMailer::Base.deliveries.first.body.encoded) - .to match("You can confirm your account email through the link below:") + .to match("Click here to confirm your email") end it "also respond as json", :aggregate_failures do diff --git a/spec/requests/supervisors_spec.rb b/spec/requests/supervisors_spec.rb index 749fdd3046..a4b0919df2 100644 --- a/spec/requests/supervisors_spec.rb +++ b/spec/requests/supervisors_spec.rb @@ -160,7 +160,7 @@ expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.first).to be_a(Mail::Message) expect(ActionMailer::Base.deliveries.first.body.encoded) - .to match("You can confirm your account email through the link below:") + .to match("Click here to confirm your email") end it "can set the supervisor to be inactive" do @@ -206,7 +206,7 @@ expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.first).to be_a(Mail::Message) expect(ActionMailer::Base.deliveries.first.body.encoded) - .to match("You can confirm your account email through the link below:") + .to match("Click here to confirm your email") end it "cannot change its own type" do diff --git a/spec/requests/users_spec.rb b/spec/requests/users_spec.rb index 065d69f919..f9cd55c468 100644 --- a/spec/requests/users_spec.rb +++ b/spec/requests/users_spec.rb @@ -256,7 +256,7 @@ expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.last.body.encoded) - .to match("You can confirm your account email through the link below:") + .to match("Click here to confirm your email") end end @@ -304,7 +304,7 @@ expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.last.body.encoded) - .to match("You can confirm your account email through the link below:") + .to match("Click here to confirm your email") end it "bypasses sign in if the current user is the true user" do @@ -363,7 +363,7 @@ expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.last.body.encoded) - .to match("You can confirm your account email through the link below:") + .to match("Click here to confirm your email") end it "bypasses sign in if the current user is the true user" do diff --git a/spec/requests/volunteers_spec.rb b/spec/requests/volunteers_spec.rb index a5578d979a..8cda127893 100644 --- a/spec/requests/volunteers_spec.rb +++ b/spec/requests/volunteers_spec.rb @@ -250,7 +250,7 @@ expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.first).to be_a(Mail::Message) expect(ActionMailer::Base.deliveries.first.body.encoded) - .to match("You can confirm your account email through the link below:") + .to match("Click here to confirm your email") end end diff --git a/spec/system/casa_admins/edit_spec.rb b/spec/system/casa_admins/edit_spec.rb index 210f65f784..2bdbfb4ae1 100644 --- a/spec/system/casa_admins/edit_spec.rb +++ b/spec/system/casa_admins/edit_spec.rb @@ -42,7 +42,7 @@ expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.first).to be_a(Mail::Message) expect(ActionMailer::Base.deliveries.first.body.encoded) - .to match("You can confirm your account email through the link below:") + .to match("Click here to confirm your email") expect(page).to have_text "Admin was successfully updated. Confirmation Email Sent." expect(page).to have_field("Email", with: @old_email) diff --git a/spec/system/supervisors/edit_spec.rb b/spec/system/supervisors/edit_spec.rb index 154cabaf9e..3cc71eb0a0 100644 --- a/spec/system/supervisors/edit_spec.rb +++ b/spec/system/supervisors/edit_spec.rb @@ -182,7 +182,7 @@ expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.first).to be_a(Mail::Message) expect(ActionMailer::Base.deliveries.first.body.encoded) - .to match("You can confirm your account email through the link below:") + .to match("Click here to confirm your email") expect(page).to have_text "Supervisor was successfully updated. Confirmation Email Sent." expect(page).to have_field("Email", with: @old_email) diff --git a/spec/system/users/edit_spec.rb b/spec/system/users/edit_spec.rb index e295388712..38e4f8a443 100644 --- a/spec/system/users/edit_spec.rb +++ b/spec/system/users/edit_spec.rb @@ -112,10 +112,12 @@ fill_in "New Email", with: "new_volunteer@example.com" click_on "Update Email" + expect(page).to have_content "Click the link in your new email to finalize the email transfer" + expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.first).to be_a(Mail::Message) expect(ActionMailer::Base.deliveries.first.body.encoded) - .to have_text("You can confirm your account email through the link below:") + .to have_text("Click here to confirm your email") end it "displays email errors messages when user is unable to set a email with incorrect current password" do @@ -264,10 +266,12 @@ fill_in "New Email", with: "new_supervisor@example.com" click_on "Update Email" + expect(page).to have_content "Click the link in your new email to finalize the email transfer" + expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.first).to be_a(Mail::Message) expect(ActionMailer::Base.deliveries.first.body.encoded) - .to match("You can confirm your account email through the link below:") + .to match("Click here to confirm your email") end it "displays email errors messages when user is unable to set a email with incorrect current password" do @@ -428,7 +432,7 @@ expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.first).to be_a(Mail::Message) expect(ActionMailer::Base.deliveries.first.body.encoded) - .to match("You can confirm your account email through the link below:") + .to match("Click here to confirm your email") end it "displays email errors messages when user is unable to set a email with incorrect current password" do diff --git a/spec/system/volunteers/edit_spec.rb b/spec/system/volunteers/edit_spec.rb index 5cc016aa7c..bb2b6c79be 100644 --- a/spec/system/volunteers/edit_spec.rb +++ b/spec/system/volunteers/edit_spec.rb @@ -145,7 +145,7 @@ expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.first).to be_a(Mail::Message) expect(ActionMailer::Base.deliveries.first.body.encoded) - .to match("You can confirm your account email through the link below:") + .to match("Click here to confirm your email") expect(page).to have_text "Volunteer was successfully updated. Confirmation Email Sent." expect(page).to have_field("Email", with: old_email)