Description
The notification system sends emails and Prowl push notifications when health checks change state. While mailer unit tests exist (spec/mailers/check_run_mailer_spec.rb), the notifier orchestration (lib/tiny_mon/notifier.rb, lib/tiny_mon/notification/) is not tested.
Critical untested behaviors:
- Is the notifier called after a check changes from success to failure?
- Is it called after failure → success recovery?
- Are notifications correctly scoped to account users who subscribed?
- Does notification failure (e.g., Prowl API down) prevent check_run from being saved?
Suggested approach
Add spec/lib/tiny_mon/notifier_spec.rb and ensure the mailer is called with the right arguments for state transitions. Use ActionMailer::Base test helpers and mock the Prowl HTTP call.
Effort: small
Description
The notification system sends emails and Prowl push notifications when health checks change state. While mailer unit tests exist (
spec/mailers/check_run_mailer_spec.rb), the notifier orchestration (lib/tiny_mon/notifier.rb,lib/tiny_mon/notification/) is not tested.Critical untested behaviors:
Suggested approach
Add
spec/lib/tiny_mon/notifier_spec.rband ensure the mailer is called with the right arguments for state transitions. Use ActionMailer::Base test helpers and mock the Prowl HTTP call.Effort: small