diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-11 10:17:24 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-11 10:17:24 +0200 |
commit | 5a903149e75465e4025f154977597aeef94b618c (patch) | |
tree | 8ce28b75e6e9ce93edf4878bfa88ef45d2443094 /spec/finders | |
parent | 99c76e9fe89434f05f63eb6227597aed882c8388 (diff) | |
download | gitlab-ce-5a903149e75465e4025f154977597aeef94b618c.tar.gz |
Handle archived projects in the `GroupDescendantsFinder`
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/group_descendants_finder_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/finders/group_descendants_finder_spec.rb b/spec/finders/group_descendants_finder_spec.rb index 4a5bdd84508..074914420a1 100644 --- a/spec/finders/group_descendants_finder_spec.rb +++ b/spec/finders/group_descendants_finder_spec.rb @@ -35,6 +35,28 @@ describe GroupDescendantsFinder do expect(finder.execute).to contain_exactly(project) end + context 'when archived is `true`' do + let(:params) { { archived: 'true' } } + + it 'includes archived projects' do + archived_project = create(:project, namespace: group, archived: true) + project = create(:project, namespace: group) + + expect(finder.execute).to contain_exactly(archived_project, project) + end + end + + context 'when archived is `only`' do + let(:params) { { archived: 'only' } } + + it 'includes only archived projects' do + archived_project = create(:project, namespace: group, archived: true) + _project = create(:project, namespace: group) + + expect(finder.execute).to contain_exactly(archived_project) + end + end + it 'does not include archived projects' do _archived_project = create(:project, :archived, namespace: group) @@ -84,6 +106,16 @@ describe GroupDescendantsFinder do expect(finder.execute).to contain_exactly(public_subgroup) end + context 'when archived is `true`' do + let(:params) { { archived: 'true' } } + + it 'includes archived projects in the count of subgroups' do + create(:project, namespace: subgroup, archived: true) + + expect(finder.execute.first.preloaded_project_count).to eq(1) + end + end + context 'with a filter' do let(:params) { { filter: 'test' } } |