Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/finders/groups_finder_spec.rb')
-rw-r--r--spec/finders/groups_finder_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/finders/groups_finder_spec.rb b/spec/finders/groups_finder_spec.rb
index 123df418f8d..25f9331005d 100644
--- a/spec/finders/groups_finder_spec.rb
+++ b/spec/finders/groups_finder_spec.rb
@@ -262,6 +262,18 @@ RSpec.describe GroupsFinder do
end
end
+ context 'with filter_group_ids' do
+ let_it_be(:group_one) { create(:group, :public, name: 'group_one') }
+ let_it_be(:group_two) { create(:group, :public, name: 'group_two') }
+ let_it_be(:group_three) { create(:group, :public, name: 'group_three') }
+
+ subject { described_class.new(user, { filter_group_ids: [group_one.id, group_three.id] }).execute }
+
+ it 'returns only the groups listed in the filter' do
+ is_expected.to contain_exactly(group_one, group_three)
+ end
+ end
+
context 'with include_ancestors' do
let_it_be(:user) { create(:user) }