aprs.me/test/aprsme_web/controllers
Graham McIntire 564d21bb26
refactor: pattern-match in TimeHelpers.to_datetime and PageController
- TimeHelpers.to_datetime: `cond` with match?/2 guards becomes five
  function heads dispatched by input type — DateTime passes through,
  NaiveDateTime anchors to UTC, integer is a millisecond Unix epoch,
  binary tries ISO 8601, everything else is nil.
- PageController.health: the three-branch `cond` + inner `if db_healthy`
  becomes a chain of small respond_* helpers, each pattern-matched on a
  single axis (health_status, shutting_down?, db_healthy?). db_healthy?/0
  isolates the rescue.
- format_uptime splits the cond into four format_uptime_parts/4 clauses.

Adds tests for the PageController actions (health 200 / 503-draining,
ready, sitemap.xml, .well-known/api-catalog, status.json). Coverage
66.81 → 67.29%.
2026-04-23 13:58:42 -05:00
..
api/v1 test: broaden unit & property-test coverage (61.8% → 64.7%) 2026-04-23 13:32:09 -05:00
error_html_test.exs refactor to use external parser 2025-06-24 14:22:09 -05:00
error_json_test.exs refactor to use external parser 2025-06-24 14:22:09 -05:00
page_controller_test.exs refactor: pattern-match in TimeHelpers.to_datetime and PageController 2026-04-23 13:58:42 -05:00