Skip to content

Polish notify-by-email validation error copy - #4619

Merged
pglombardo merged 2 commits into
masterfrom
polish-notify-by-email-validation-errors
Jul 6, 2026
Merged

Polish notify-by-email validation error copy#4619
pglombardo merged 2 commits into
masterfrom
polish-notify-by-email-validation-errors

Conversation

@pglombardo

Copy link
Copy Markdown
Owner

Summary

  • Add humanized attribute names for notify-by-email fields (Recipient emails, Notification language) so full_messages read naturally in the UI and job error output.
  • Fix grammatically awkward validation suffixes (e.g. "are not available" vs "is not available") and consolidate the daily email limit message to a single base-level error.
  • Update API, controller, model, system, and job tests to match the improved copy.

Test plan

  • bin/ci passes locally (RuboCop, ERB lint, i18n health, Brakeman, importmap audit, Rails tests, system tests, seeds)
  • Notify-by-email model, API v2, controller, job, and system tests updated and passing

Made with Cursor

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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_messages read 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.

Comment thread app/models/concerns/pwpush/notifiable_by_email.rb
Comment thread app/models/concerns/pwpush/notifiable_by_email.rb Outdated
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

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)"
@pglombardo
pglombardo merged commit 4ea6481 into master Jul 6, 2026
3 checks passed
@pglombardo
pglombardo deleted the polish-notify-by-email-validation-errors branch July 6, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants