Skip to content

5563 - Replace value parameter spec stubs with real tests#7068

Open
fuentesjr wants to merge 4 commits into
rubyforgood:mainfrom
fuentesjr:5563-values-specs
Open

5563 - Replace value parameter spec stubs with real tests#7068
fuentesjr wants to merge 4 commits into
rubyforgood:mainfrom
fuentesjr:5563-values-specs

Conversation

@fuentesjr

@fuentesjr fuentesjr commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What github issue is this PR for, if any?

Part of #5563, intentionally not Resolves, since the umbrella has more stubs remaining.

What changed, and why?

Replaces the four pending "add some tests for X" stubs in spec/values/ with real specs (one commit per file), following the patterns in case_contact_parameters_spec.rb, volunteer_parameters_spec.rb, and banner_parameters_spec.rb:

  • UserParameters carries the bulk of the coverage: the permit allowlist (including nested address_attributes), ParameterMissing on a missing root key, and every builder method (with_organization, with_password, with_type, without_type, without_active, with_only, without)
  • SupervisorParameters / CasaAdminParameters are thin subclasses that only fix the root param key (:supervisor / :casa_admin); specs pin the root key, ParameterMissing, and one inherited builder each rather than re-testing the parent
  • AllCasaAdminParameters is a separate SimpleDelegator: email/password passthrough, unpermitted filtering, ParameterMissing, and with_password

Rebased on current main after #7070 landed. #7070 already added a user_parameters_spec.rb; this PR extends that file with the broader value-object coverage above (allowlist, ParameterMissing, with_type, with_only) and adds the three sibling parameter specs it didn't touch. The #without specs here assert the corrected behavior from #7070, not the old bug. No app code changed.

How is this tested? (please write rspec and jest tests!) 💖💪

  • bundle exec rspec spec/values/user_parameters_spec.rb spec/values/supervisor_parameters_spec.rb spec/values/casa_admin_parameters_spec.rb spec/values/all_casa_admin_parameters_spec.rb gives 22 examples, 0 failures, 0 pending
  • bundle exec standardrb spec/values/ reports no offenses
  • No pending / skip / xit remains in the four files

Screenshots please :)

N/A, test-only change, no UI.

@fuentesjr

Copy link
Copy Markdown
Contributor Author

Rebased on main now that #7070 has merged. Reconciled user_parameters_spec.rb so it extends the coverage from #7070 (adds the permit allowlist, ParameterMissing, with_type, and with_only) and asserts the corrected #without behavior rather than the old bug. The other three files (supervisor, casa_admin, all_casa_admin parameter specs) were untouched by #7070. Green locally: 22 examples, 0 failures.

@fuentesjr
fuentesjr force-pushed the 5563-values-specs branch from 01ccd91 to bd1b9ac Compare July 21, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ruby Touches Ruby code 🧪 Tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant