Created request specs for CaseGroups controller (they were allowed-skipped)
CaseGroupController did not have a policy to use (but everything was built from current_organization)
Wanted to add a policy generator since the pundit:policy generator is so minimal
Created a CaseGroup policy (and spec), and refined generator based on that
Incorporate a policy into the controller, as used in other routes
Created hooks for rails controller and scaffold generators to ensure a policy is generated along with them
How is this tested? (please write tests!) 💖💪
The request spec was created with the controller as-is, and made to pass.
Then the policy changes were made in the controller without changing specs -- with one exception: The update action redirected to new rather than traditional edit redirect. I made that change.
NOTES:
This commit contains the changes from generated policy to make policy spec pass.
I also made some custom scaffold and controller request spec templates, but that may be too much to include here, I will open a separate PR for those.
What github issue is this PR for, if any?
Addresses #5563
What changed, and why?
pundit:policy
generator is so minimalHow is this tested? (please write tests!) 💖💪
The request spec was created with the controller as-is, and made to pass.
Then the policy changes were made in the controller without changing specs -- with one exception: The update action redirected to new rather than traditional edit redirect. I made that change.
NOTES:
Screenshots please :)
Policy generator help:
Feelings gif (optional)