Skip to content

Instantly share code, notes, and snippets.

@compwron
Created March 21, 2026 20:49
Show Gist options
  • Select an option

  • Save compwron/e1c399823b0c56c2b9cd1091abe3c243 to your computer and use it in GitHub Desktop.

Select an option

Save compwron/e1c399823b0c56c2b9cd1091abe3c243 to your computer and use it in GitHub Desktop.
CASA test coverage gaps analysis - 2026-03-21

CASA Test Coverage Gaps

High Priority — Complex business logic, no real tests

Area File Gap
Emancipation checklist app/controllers/emancipations_controller.rb JSON API with 5+ action types (ADD/DELETE category/option, SET_OPTION) — zero tests
Placements CRUD app/controllers/placements_controller.rb Full CRUD for youth placement records — only a pending placeholder spec
Admin user creation app/services/create_casa_admin_service.rb Creates admin users with org setup — placeholder spec only
System admin creation app/services/create_all_casa_admin_service.rb Creates system-wide admins — placeholder spec only
Case contacts CSV export app/services/case_contacts_export_csv_service.rb Primary reporting export — placeholder spec only

Medium Priority — Report/export flows with no or minimal tests

Area File Gap
Followup reports app/controllers/followup_reports_controller.rb CSV export with authorization — placeholder only
Mileage reports app/controllers/mileage_reports_controller.rb Reimbursement CSV export — placeholder only
Learning hour topics app/controllers/learning_hour_topics_controller.rb CRUD operations — placeholder only
Learning hour types app/controllers/learning_hour_types_controller.rb CRUD operations — placeholder only
Court report date formatting app/services/court_report_format_contact_date.rb Used in court report generation — placeholder only
FDF inputs (PDF forms) app/services/fdf_inputs_service.rb PDF form generation — placeholder only

Lower Priority — Thin coverage on important models/services

  • FundRequest model — only 1 assertion (validates presence), no tests on business logic
  • MileageExportCsvService — 24 lines, minimal path coverage
  • PlacementExportCsvService — 15 lines, minimal coverage
  • CasaCaseChangeService — 23 lines, tracks case status transitions
  • 13 models with <15-line specs testing only associations:
    • AllCasaAdmin, Address, ApplicationRecord, CaseGroupMembership, FundRequest, LoginActivity, PatchNote, PatchNoteGroup, PatchNoteType, PlacementType, SentEmail, SmsNotificationEvent, UserSmsNotificationEvent

Well Covered

  • All 40 Pundit policies have corresponding specs
  • All 7 mailers have specs
  • Core flows (case contacts, volunteers, supervisors, court reports controllers) have substantive specs

Recommended Starting Points

  1. EmancipationsController — most complex untested controller with branching JSON logic
  2. CreateCasaAdminService / CreateAllCasaAdminService — user creation is security-critical
  3. CaseContactsExportCsvService — primary data export, used for grant reporting
  4. PlacementsController — full CRUD with no coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment