提交 2c3c5b35 编写于 作者: B Bob Van Landuyt

Don't include projects shared as group-descendants

When a project is shared with a group, it should not be included as a
descendant on the group dashboard.
上级 c56326fc
......@@ -121,8 +121,10 @@ class GroupDescendantsFinder
end
def direct_child_projects
GroupProjectsFinder.new(group: parent_group, current_user: current_user, params: params)
.execute
GroupProjectsFinder.new(group: parent_group,
current_user: current_user,
options: { only_owned: true },
params: params).execute
end
# Finds all projects nested under `parent_group` or any of its descendant
......
......@@ -35,6 +35,15 @@ describe GroupDescendantsFinder do
expect(finder.execute).to contain_exactly(project)
end
it 'does not include projects shared with the group' do
project = create(:project, namespace: group)
other_project = create(:project)
other_project.project_group_links.create(group: group,
group_access: ProjectGroupLink::MASTER)
expect(finder.execute).to contain_exactly(project)
end
context 'when archived is `true`' do
let(:params) { { archived: 'true' } }
......@@ -64,7 +73,7 @@ describe GroupDescendantsFinder do
end
context 'with a filter' do
let(:params) { { filter: 'test' } }
let(:params) { { filter: 'tes' } }
it 'includes only projects matching the filter' do
_other_project = create(:project, namespace: group)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册