Invert method's naming

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2016-09-16 13:37:21 +02:00
parent c8b1311934
commit e9d7b4f765
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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)