diff options
Diffstat (limited to 'spec/finders/groups_finder_spec.rb')
-rw-r--r-- | spec/finders/groups_finder_spec.rb | 12 |
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) } |