diff options
author | Olivier Gonzalez <ogonzalez@gitlab.com> | 2018-11-06 02:56:52 +0300 |
---|---|---|
committer | Olivier Gonzalez <ogonzalez@gitlab.com> | 2018-11-06 02:56:52 +0300 |
commit | a89fb014a3f520d44351489bca73a42f3d4d42e8 (patch) | |
tree | 5d5274efd590da2184665e11e18e722a3026a076 /spec/models/namespace_spec.rb | |
parent | 57bc28e7907cc5166030c10638a2c756cb45dcaa (diff) |
Backport generic methods to CE
Allow to fetch all pipelines for every projects in a group and its
subgroups.
Allow to fetch the latest pipeline id for each projects of a group and
its subgroups.
Diffstat (limited to 'spec/models/namespace_spec.rb')
-rw-r--r-- | spec/models/namespace_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb index 8913644a3ce..2db42fe802a 100644 --- a/spec/models/namespace_spec.rb +++ b/spec/models/namespace_spec.rb @@ -562,6 +562,17 @@ describe Namespace do it { expect(group.all_projects.to_a).to match_array([project2, project1]) } end + describe '#all_pipelines' do + let(:group) { create(:group) } + let(:child) { create(:group, parent: group) } + let!(:project1) { create(:project_empty_repo, namespace: group) } + let!(:project2) { create(:project_empty_repo, namespace: child) } + let!(:pipeline1) { create(:ci_empty_pipeline, project: project1) } + let!(:pipeline2) { create(:ci_empty_pipeline, project: project2) } + + it { expect(group.all_pipelines.to_a).to match_array([pipeline1, pipeline2]) } + end + describe '#share_with_group_lock with subgroups', :nested_groups do context 'when creating a subgroup' do let(:subgroup) { create(:group, parent: root_group )} |