5563 - Replace policy spec stubs with real tests#7053
Open
fuentesjr wants to merge 4 commits into
Open
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 — intentionally not
Resolves, since the umbrella has more stubs remaining.What changed, and why?
Replaces the four
pending "add some tests for X"stubs inspec/policies/with real specs (one commit per file), using the pundit-matcherspermissionsDSL andbuild_stubbed, following the patterns inchecklist_item_policy_spec.rbandcustom_org_link_policy_spec.rb:create?/edit?/update?/destroy?(all delegate toadmin_or_supervisor?): casa_admin and supervisor permitted, volunteer deniednew?/create?are intentionally unconditional; the spec pins that all roles (and even a nil user) are permitted, with a NOTE explaining access is constrained upstream byFundRequestsController#verify_casa_casenew?/create?/edit?/update?) their controllers rely on: casa_admin permitted, supervisor and volunteer deniedCoverage matches each controller's authorized actions exactly. None of these policies define a
Scopeorpermitted_attributes, so no org-scoping specs apply.How is this tested? (please write rspec and jest tests!) 💖💪
bundle exec rspec spec/policies/note_policy_spec.rb spec/policies/fund_request_policy_spec.rb spec/policies/learning_hour_topic_policy_spec.rb spec/policies/learning_hour_type_policy_spec.rb→ 13 examples, 0 failures, 0 pendingbundle exec standardrb spec/policies/→ no offensespending/skip/xitremains in the four filesScreenshots please :)
N/A — test-only change, no UI.