Skip to content

Show email confirmation status on user profile page (#6626)#7009

Open
augustocbx wants to merge 1 commit into
rubyforgood:mainfrom
augustocbx:6626-email-confirmation-status
Open

Show email confirmation status on user profile page (#6626)#7009
augustocbx wants to merge 1 commit into
rubyforgood:mainfrom
augustocbx:6626-email-confirmation-status

Conversation

@augustocbx

Copy link
Copy Markdown

What github issue is this PR for, if any?

Addresses part of #6626 (does not auto-close it — see scope note below).

What changed, and why?

Issue #6626 ("Improved Email Understanding") asks for three things on the user page:

  1. Show all old emails for the user
  2. Show the un/confirmed status of the current email
  3. Send the confirmation email to both the old and new addresses on an email change

This PR delivers item 2 only, kept deliberately small and self-contained:

  • Adds an "Email confirmation status" line ("Confirmed" / "Not confirmed") to the account info on the Edit Profile page.
  • Adds a "Pending email confirmation" line showing the unconfirmed_email whenever an email change is awaiting confirmation (Devise reconfirmable).

The status string lives in UserDecorator#email_confirmation_status (presentation logic in the decorator, per the project conventions), and the view renders it in app/views/users/_edit_profile.erb right next to the existing Email line. No model, migration, controller, or dependency changes — :confirmable is already enabled on User.

Scope note (intentionally left as follow-ups):

  • Item 1 (show all old emails) needs email-change history/versioning, which is a much larger change.
  • Item 3 (dual-send the confirmation email) is the security trade-off the issue itself flags with a "?", so it needs a maintainer/product decision rather than an implementation choice.

I'm happy to open follow-up PRs for either once there's direction.

How is this tested? (please write rspec and jest tests!) 💖💪

  • spec/decorators/user_decorator_spec.rb — unit specs for #email_confirmation_status covering the confirmed and not-confirmed cases.
  • spec/system/users/edit_spec.rb — system specs verifying the Edit Profile page shows the confirmation status, and shows the pending email when a reconfirmation is in progress.

Commands run locally:

  • bundle exec rspec spec/decorators/user_decorator_spec.rb spec/system/users/edit_spec.rb56 examples, 0 failures
  • bundle exec standardrb app/decorators/user_decorator.rb spec/decorators/user_decorator_spec.rb spec/system/users/edit_spec.rbclean
  • bundle exec erb_lint app/views/users/_edit_profile.erbNo errors were found in ERB files

The system specs fail without the view change and pass with it.

Screenshots please :)

Edit Profile page (/users/edit) with the new lines, while an email change is pending confirmation:

CASA organization CASA Org 1
Added to system June 17, 2026 …
Email email1@example.com
Email confirmation status Confirmed
Pending email confirmation new-email@example.com
Invitation email sent never

(Will attach the rendered screenshot in a comment.)

@github-actions github-actions Bot added 🧪 Tests Tests ruby Touches Ruby code erb Touches ERB templates labels Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

erb Touches ERB templates ruby Touches Ruby code 🧪 Tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant