Skip to content

add comprehensive test coverage for the award notice functionality in both the controller and model layers - #285

Merged
rsmoke merged 2 commits into
mainfrom
staging
Sep 28, 2026
Merged

rsmoke merged 2 commits into
mainfrom
staging

Conversation

@rsmoke

@rsmoke rsmoke commented Sep 28, 2026

Copy link
Copy Markdown
Member

This pull request adds comprehensive test coverage for the award notice functionality in both the controller and model layers. The main focus is verifying correct behavior when sending award notices, handling user preferences, and ensuring only eligible entries are included as recipients.

Controller test additions:

  • Adds tests to ensure award notices are queued without amounts when the user preference is off, and that mail is not queued (with an alert shown) if there are no awarded entries to notify.
  • Adds a test to verify that the award notice recipients are correctly loaded for the award email preferences screen.

Model test additions:

  • Adds tests for the award_notice_entries method in ContestInstance, confirming it includes winners, finalists, and entries with assigned prizes, while excluding unawarded entries and soft-deleted winners.

cursoragent and others added 2 commits September 24, 2026 10:16
Cover ContestInstance#award_notice_entries inclusion/exclusion rules and
send_award_notices empty/include_amounts/preferences edge cases so the
wrong applicants are not emailed after awards changes.

Co-authored-by: rsmoke <rsmoke@umich.edu>
Add award notice recipient and send-path regression coverage
Copilot AI lite review requested due to automatic review settings September 28, 2026 13:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Tighten the controller expectation to verify the specific recipient and exact call count.

Review effort: Lite
Findings: None

What changed in this PR

Adds controller and model test coverage for award notice eligibility, preferences, delivery, and empty-recipient handling.

Changes:

  • Tests eligible and excluded notice recipients.
  • Tests amount preferences and alert behavior.
  • Tests recipient loading for email preferences.
File Summary
spec/​models/​contest_instance_spec.rb Covers award notice entry eligibility rules.
spec/​controllers/​contest_instances_controller_spec.rb Covers notice sending and recipient loading.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@rsmoke
rsmoke merged commit 2a10336 into main Sep 28, 2026
11 checks passed

This branch was successfully deployed

1 active deployment
staging — d5c2e98e Deployed Sep 28, 2026 by hatchbox-io[bot]
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.

3 participants