diff options
Diffstat (limited to 'spec/finders/group_descendants_finder_spec.rb')
-rw-r--r-- | spec/finders/group_descendants_finder_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/finders/group_descendants_finder_spec.rb b/spec/finders/group_descendants_finder_spec.rb index 9cadd9a6000..375bcc9087e 100644 --- a/spec/finders/group_descendants_finder_spec.rb +++ b/spec/finders/group_descendants_finder_spec.rb @@ -73,7 +73,7 @@ describe GroupDescendantsFinder do end context 'with a filter' do - let(:params) { { filter: 'tes' } } + let(:params) { { filter: 'test' } } it 'includes only projects matching the filter' do _other_project = create(:project, namespace: group) @@ -198,6 +198,17 @@ describe GroupDescendantsFinder do expect(finder.execute).to contain_exactly(subgroup, matching_project) end + context 'with a small page size' do + let(:params) { { filter: 'test', per_page: 1 } } + + it 'contains all the ancestors of a matching subgroup regardless the page size' do + subgroup = create(:group, :private, parent: group) + matching = create(:group, :private, name: 'testgroup', parent: subgroup) + + expect(finder.execute).to contain_exactly(subgroup, matching) + end + end + it 'does not include the parent itself' do group.update!(name: 'test') |