-
-
Notifications
You must be signed in to change notification settings - Fork 927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin policy test coverage #5262
base: master
Are you sure you want to change the base?
Conversation
Remove unused code in Api::ApplicationPolicy
cd621ff
to
f8115a3
Compare
@martinemde happy to finish the rest later (in additional PR) |
f8115a3
to
6cd0f31
Compare
@simi If it seems useful, we can continue. I noticed that their coverage is "fake" before this (i.e. the method is called so it counts as coverage). I'm aiming for a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could remove this part of the code if we think it's too unfinished.
refute_authorizes(user, record, :"view_#{association}?") | ||
end | ||
|
||
# TODO: I'm not clear on what `record` is used in show_association? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intention here was to use the passed policy to assert that it refers to that policy, but I'm unclear on how that works.
Is it really getting passed the "object" of the association as the record or are we just looking up the same policy as self because it's not a different record? That would imply that record is not a RubyGem in the RubyGemPolicy when we plan on checking show_association?
I started a pattern here for testing associations but I'm getting really bored of adding it all 🥱 Maybe we can finish it later. It's very repetitive.