Skip to content
Snippets Groups Projects
Commit e13753fc authored by Bob Van Landuyt's avatar Bob Van Landuyt
Browse files

Only take unarchived projects into account

When finding children for a group
parent 29df1ce8
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -6,7 +6,7 @@ class GroupDescendantsFinder
def initialize(current_user: nil, parent_group:, params: {})
@current_user = current_user
@parent_group = parent_group
@params = params
@params = params.reverse_merge(non_archived: true)
end
 
def execute
Loading
Loading
@@ -74,7 +74,7 @@ class GroupDescendantsFinder
end
 
def projects_matching_filter
ProjectsFinder.new(current_user: current_user).execute
ProjectsFinder.new(current_user: current_user, params: params).execute
.search(params[:filter])
.where(namespace: all_descendant_groups)
end
Loading
Loading
Loading
Loading
@@ -19,6 +19,12 @@ describe GroupDescendantsFinder do
expect(finder.execute).to contain_exactly(project)
end
 
it 'does not include archived projects' do
_archived_project = create(:project, :archived, namespace: group)
expect(finder.execute).to be_empty
end
context 'with a filter' do
let(:params) { { filter: 'test' } }
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment