diff options
author | Rémy Coutable <remy@rymai.me> | 2019-03-19 20:24:16 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-03-21 19:31:41 +0300 |
commit | 30a4e5532dcf7a866319086a4e690a54e16e587f (patch) | |
tree | 3c43cf3f1b7e1946af1012ae5bc9bc1ddbdbb3bc /spec/support/shared_contexts/finders | |
parent | 284d3e563e71ef011f131e76edb6159c8622226a (diff) |
[CE] Reduce differences with EE in group_projects_finder_spec.rb
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/support/shared_contexts/finders')
-rw-r--r-- | spec/support/shared_contexts/finders/group_projects_finder_shared_contexts.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/support/shared_contexts/finders/group_projects_finder_shared_contexts.rb b/spec/support/shared_contexts/finders/group_projects_finder_shared_contexts.rb new file mode 100644 index 00000000000..a0d994c4d8d --- /dev/null +++ b/spec/support/shared_contexts/finders/group_projects_finder_shared_contexts.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +RSpec.shared_context 'GroupProjectsFinder context' do + let(:group) { create(:group) } + let(:subgroup) { create(:group, parent: group) } + let(:current_user) { create(:user) } + let(:options) { {} } + + let(:finder) { described_class.new(group: group, current_user: current_user, options: options) } + + let!(:public_project) { create(:project, :public, group: group, path: '1') } + let!(:private_project) { create(:project, :private, group: group, path: '2') } + let!(:shared_project_1) { create(:project, :public, path: '3') } + let!(:shared_project_2) { create(:project, :private, path: '4') } + let!(:shared_project_3) { create(:project, :internal, path: '5') } + let!(:subgroup_project) { create(:project, :public, path: '6', group: subgroup) } + let!(:subgroup_private_project) { create(:project, :private, path: '7', group: subgroup) } + + before do + shared_project_1.project_group_links.create(group_access: Gitlab::Access::MAINTAINER, group: group) + shared_project_2.project_group_links.create(group_access: Gitlab::Access::MAINTAINER, group: group) + shared_project_3.project_group_links.create(group_access: Gitlab::Access::MAINTAINER, group: group) + end +end |