Show email confirmation status on user profile page (#6626)#7009
Open
augustocbx wants to merge 1 commit into
Open
Show email confirmation status on user profile page (#6626)#7009augustocbx wants to merge 1 commit into
augustocbx wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
This PR delivers item 2 only, kept deliberately small and self-contained:
unconfirmed_emailwhenever 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 inapp/views/users/_edit_profile.erbright next to the existing Email line. No model, migration, controller, or dependency changes —:confirmableis already enabled onUser.Scope note (intentionally left as follow-ups):
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_statuscovering 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.rb→ 56 examples, 0 failuresbundle exec standardrb app/decorators/user_decorator.rb spec/decorators/user_decorator_spec.rb spec/system/users/edit_spec.rb→ cleanbundle exec erb_lint app/views/users/_edit_profile.erb→ No errors were found in ERB filesThe 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:(Will attach the rendered screenshot in a comment.)