test: replace ByOrganizationScope and Roles spec stubs with real tests (#5563)#7004
Open
augustocbx wants to merge 1 commit into
Open
test: replace ByOrganizationScope and Roles spec stubs with real tests (#5563)#7004augustocbx wants to merge 1 commit into
augustocbx wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inspec/models/concerns/, so they are bundled as one themed PR:spec/models/concerns/by_organization_scope_spec.rb— exercises the.by_organizationscope throughCasaCase: records from anotherCasaOrgare 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#rolefor all four including user types:Volunteer,Supervisor,CasaAdmin, and the separateAllCasaAdminmodel.No
pending,skip, orxitremains 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 failuresbundle exec rspec spec/models/concerns/→ 6 examples, 0 failures, 2 pending (the two remaining stub files in that directory,api_spec.rbandCasaCase/validations_spec.rb, left for follow-up PRs)bundle exec standardrb spec/models/concerns/→ cleanScreenshots please :)
No UI changes — test-only PR.