Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions app/views/devise/mailer/confirmation_instructions.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<p>Hello! <%= @email %>!</p>

<p>You can confirm your account email through the link below:</p>

<p>Click here to confirm your email.</p>
<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
<p>If you weren't expecting this email, please disregard.</p>
Comment on lines +1 to +3
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to issue #6638, the email should have a confirmation link with the text "Click here to finish updating your email." followed by the disclaimer. The current implementation has separate text on line 1 and a link with different text ("Confirm my account") on line 2. Consider making the instruction itself the clickable link text, and update the wording to match the requirement: "Click here to finish updating your email."

Suggested change
<p>Click here to confirm your email.</p>
<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
<p>If you weren't expecting this email, please disregard.</p>
<p><%= link_to 'Click here to finish updating your email.', confirmation_url(@resource, confirmation_token: @token) %></p>
<p>If you weren't expecting this email, please disregard.</p>

Copilot uses AI. Check for mistakes.
2 changes: 1 addition & 1 deletion spec/requests/all_casa_admins/casa_admins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/casa_admins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/requests/supervisors_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/requests/users_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/volunteers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spec/system/casa_admins/edit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spec/system/supervisors/edit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 7 additions & 3 deletions spec/system/users/edit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@
fill_in "New Email", with: "[email protected]"
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
Expand Down Expand Up @@ -264,10 +266,12 @@
fill_in "New Email", with: "[email protected]"
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
Expand Down Expand Up @@ -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")
Comment on lines 432 to +435
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is missing an assertion to verify that the flash message "Click the link in your new email to finalize the email transfer" is displayed to the user. This message should be tested here just like it is for volunteers (line 115) and supervisors (line 269) in this same file.

Copilot uses AI. Check for mistakes.
end

it "displays email errors messages when user is unable to set a email with incorrect current password" do
Expand Down
2 changes: 1 addition & 1 deletion spec/system/volunteers/edit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading