Commit 6388b8fe authored by Bob Van Landuyt's avatar Bob Van Landuyt
Browse files

Don't include the parent in search results if it matches

parent 1301fa1655a8
......@@ -52,7 +52,7 @@ def all_subgroups
end
def subgroups_matching_filter
all_subgroups.search(params[:filter])
all_subgroups.where.not(id: parent_group).search(params[:filter])
end
def subgroups
......
......@@ -60,6 +60,12 @@
expect(finder.execute).to contain_exactly(matching_project)
end
it 'does not include the parent itself' do
group.update!(name: 'test')
expect(finder.execute).not_to include(group)
end
end
end
end
......
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