Skip to content

5260 suppress erroneous email reset warning #6408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

JenMcD-star
Copy link
Contributor

What github issue is this PR for, if any?

Resolves #5260

What changed, and why?

A method (def update) was added to override the default Devise behavior that was causing an erroneous warning regarding email confirmation. The users should not be given that warning as emails are automatically, manually, labeled as confirmed when an account is created.

Now when a password is successfully updated the user will only see the success message.

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

Note: if you see a flake in your test build in github actions, please post in slack #casa "Flaky test: " :) 💪
Note: We love capybara tests! If you are writing both haml/js and ruby, please try to test your work with tests at every level including system tests like https://github.com/rubyforgood/casa/tree/main/spec/system

A test was added to spec/requests/users/passwords_spec.rb,

Screenshots please :)

Run your local server and take a screenshot of your work! Try to include the URL of the page as well as the contents of the page.
Screenshot from 2025-05-26 12-31-31

Feelings gif (optional)

What gif best describes your feeling working on this issue? https://giphy.com/
How to embed:

![alt text](https://media.giphy.com/media/1nP7ThJFes5pgXKUNf/giphy.gif)

@github-actions github-actions bot added ruby Pull requests that update Ruby code Tests! 🎉💖👏 labels May 29, 2025
@JenMcD-star JenMcD-star marked this pull request as draft May 29, 2025 16:22
@JenMcD-star JenMcD-star marked this pull request as ready for review May 29, 2025 16:52
Copy link
Collaborator

@compwron compwron left a comment

Choose a reason for hiding this comment

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

nice! Thanks :)

@compwron compwron requested a review from Copilot June 9, 2025 16:43
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR resolves issue #5260 by overriding Devise’s default behavior to suppress an erroneous email confirmation warning when a password is updated. Key changes include adding an update method in the passwords controller to handle custom password resets and introducing a new request spec to verify the success path.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
spec/requests/users/passwords_spec.rb Adds a request spec for the password update behavior
app/controllers/users/passwords_controller.rb Implements a custom update method to override Devise’s behavior
Comments suppressed due to low confidence (2)

app/controllers/users/passwords_controller.rb:28

  • Consider using new_user_session_path explicitly for redirection to match the test expectations and ensure consistent behavior.
redirect_to new_session_path(resource_name)

spec/requests/users/passwords_spec.rb:146

  • Consider adding test coverage for the failure scenario to verify that error responses are handled appropriately.
it "successfully resets the password" do

@compwron compwron merged commit 7437b2a into rubyforgood:main Jun 9, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Pull requests that update Ruby code Tests! 🎉💖👏
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suppress Erroneous Email Reset Warning
2 participants