Invert method's naming
Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
parent
c8b1311934
commit
e9d7b4f765
2 changed files with 4 additions and 4 deletions
|
@ -17,7 +17,7 @@ module Members
|
|||
|
||||
member = find_member!(scope)
|
||||
|
||||
raise Gitlab::Access::AccessDeniedError if cannot_destroy_member?(member)
|
||||
raise Gitlab::Access::AccessDeniedError unless can_destroy_member?(member)
|
||||
|
||||
AuthorizedDestroyService.new(member, current_user).execute
|
||||
end
|
||||
|
@ -35,8 +35,8 @@ module Members
|
|||
end
|
||||
end
|
||||
|
||||
def cannot_destroy_member?(member)
|
||||
!member || !can?(current_user, action_member_permission(:destroy, member), member)
|
||||
def can_destroy_member?(member)
|
||||
member && can?(current_user, action_member_permission(:destroy, member), member)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -213,7 +213,7 @@ describe API::AccessRequests, api: true do
|
|||
end.to change { source.requesters.count }.by(-1)
|
||||
end
|
||||
|
||||
context 'user_id matches a member' do
|
||||
context 'user_id matches a member, not an access requester' do
|
||||
it 'returns 404' do
|
||||
expect do
|
||||
delete api("/#{source_type.pluralize}/#{source.id}/access_requests/#{developer.id}", master)
|
||||
|
|
Loading…
Reference in a new issue