Skip to content

test: replace ByOrganizationScope and Roles spec stubs with real tests (#5563)#7004

Open
augustocbx wants to merge 1 commit into
rubyforgood:mainfrom
augustocbx:5563-model-concern-spec-stubs
Open

test: replace ByOrganizationScope and Roles spec stubs with real tests (#5563)#7004
augustocbx wants to merge 1 commit into
rubyforgood:mainfrom
augustocbx:5563-model-concern-spec-stubs

Conversation

@augustocbx

Copy link
Copy Markdown

What github issue is this PR for, if any?

Part of #5563 (umbrella — replaces 2 of the remaining stub specs; intentionally not using "Resolves" so the umbrella stays open)

What changed, and why?

Replaced two pending "add some tests for X" stub specs (introduced in #6517) with real tests, following the definition of done in the issue body. Both files live in spec/models/concerns/, so they are bundled as one themed PR:

  • spec/models/concerns/by_organization_scope_spec.rb — exercises the .by_organization scope through CasaCase: records from another CasaOrg are excluded, and an org with no records gets an empty result. This concern is the core of the app's multi-tenancy, so it seemed worth covering first.
  • spec/models/concerns/roles_spec.rb — exercises #role for all four including user types: Volunteer, Supervisor, CasaAdmin, and the separate AllCasaAdmin model.

No pending, skip, or xit remains in either file.

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

This PR is tests. Commands run locally:

  • bundle exec rspec spec/models/concerns/by_organization_scope_spec.rb spec/models/concerns/roles_spec.rb → 4 examples, 0 failures
  • bundle exec rspec spec/models/concerns/ → 6 examples, 0 failures, 2 pending (the two remaining stub files in that directory, api_spec.rb and CasaCase/validations_spec.rb, left for follow-up PRs)
  • bundle exec standardrb spec/models/concerns/ → clean

Screenshots please :)

No UI changes — test-only PR.

@github-actions github-actions Bot added 🧪 Tests Tests ruby Touches Ruby code labels Jun 12, 2026
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