Commit cd7bc802 authored by Małgorzata Ksionek's avatar Małgorzata Ksionek

Fix get endpoint not returning members with minimal access

parent c0f74cfd
......@@ -114,6 +114,27 @@ RSpec.describe API::Members do
end
end
end
describe 'GET /groups/:id/members/:user_id' do
context 'when minimal access role is available' do
it 'shows the member' do
stub_licensed_features(minimal_access_role: true)
get api("/groups/#{group.id}/members/#{minimal_access_member.user_id}", owner)
expect(response).to have_gitlab_http_status(:ok)
puts json_response
expect(json_response['id']).to eq(minimal_access_member.user_id)
end
end
context 'when minimal access role is not available' do
it 'does not show the member' do
get api("/groups/#{group.id}/members/#{minimal_access_member.id}", owner)
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
end
context 'group members endpoint for group managed accounts' do
......
......@@ -62,7 +62,7 @@ module API
get ":id/members/:user_id" do
source = find_source(source_type, params[:id])
members = source.members
members = source_members(source)
member = members.find_by!(user_id: params[:user_id])
present_members member
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment