Polish notify-by-email validation error copy - #4619
Merged
Merged
Conversation
Use humanized attribute names and grammatically correct messages so UI, API, and job error output read naturally instead of exposing awkward wording like "Notify emails to is not available." Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the user-facing (and job/log-facing) validation error copy for the “notify by email” feature by introducing human-friendly attribute names and polishing several validation message suffixes, with corresponding test updates across the stack.
Changes:
- Add custom humanized attribute names for notify-by-email fields so
errors.full_messagesread naturally. - Adjust notify-by-email validation message suffixes (e.g., “are not available” for plural “Recipient emails”) and consolidate the daily email limit into a single base error.
- Update unit, model, controller, API, and system tests to assert on the new copy.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| app/models/concerns/pwpush/notifiable_by_email.rb | Introduces humanized attribute names and revises notify-by-email validation messages. |
| app/models/push.rb | Updates expired-push notify-by-email validation suffix to match new pluralized copy. |
| test/unit/send_notify_by_email_job_test.rb | Updates expected job error message text derived from full_messages. |
| test/system/notify_by_email_test.rb | Updates UI/system assertion to match new validation copy. |
| test/models/concerns/pwpush/notifiable_by_email_test.rb | Updates model validation assertions for the revised message suffixes. |
| test/integration/api/api_v2_pushes_test.rb | Updates API v2 error payload expectations for revised message text. |
| test/controllers/pushes_controller_test.rb | Updates controller response body assertions for revised full_messages copy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Use literal gettext calls in human_attribute_name so strings are extractable, and reword owner-only validation to "allowed only for owners." Co-authored-by: Cursor <cursoragent@cursor.com>
Comment on lines
39
to
+42
| fill_in "push[notify_emails_to]", with: "test@example.com, invalid-email" | ||
| click_on "Send Emails" | ||
|
|
||
| assert_text "Notify emails to contains invalid email(s)" | ||
| assert_text "Recipient emails contains invalid email(s)" |
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.
Summary
Recipient emails,Notification language) sofull_messagesread naturally in the UI and job error output.Test plan
bin/cipasses locally (RuboCop, ERB lint, i18n health, Brakeman, importmap audit, Rails tests, system tests, seeds)Made with Cursor