2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
RSpec.shared_context 'GroupProjectsFinder context' do
|
2021-01-29 00:20:46 +05:30
|
|
|
let_it_be(:group) { create(:group) }
|
|
|
|
let_it_be(:subgroup) { create(:group, parent: group) }
|
|
|
|
let_it_be(:current_user) { create(:user) }
|
2019-12-04 20:38:33 +05:30
|
|
|
let(:params) { {} }
|
2019-07-07 11:18:12 +05:30
|
|
|
let(:options) { {} }
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
let(:finder) { described_class.new(group: group, current_user: current_user, params: params, options: options) }
|
2019-07-07 11:18:12 +05:30
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
let_it_be(:public_project) { create(:project, :public, group: group, path: '1') }
|
|
|
|
let_it_be(:private_project) { create(:project, :private, group: group, path: '2') }
|
|
|
|
let_it_be(:shared_project_1) { create(:project, :public, path: '3') }
|
|
|
|
let_it_be(:shared_project_2) { create(:project, :private, path: '4') }
|
|
|
|
let_it_be(:shared_project_3) { create(:project, :internal, path: '5') }
|
|
|
|
let_it_be(:subgroup_project) { create(:project, :public, path: '6', group: subgroup) }
|
|
|
|
let_it_be(:subgroup_private_project) { create(:project, :private, path: '7', group: subgroup) }
|
2019-07-07 11:18:12 +05:30
|
|
|
|
|
|
|
before do
|
2021-01-03 14:25:43 +05:30
|
|
|
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)
|
2019-07-07 11:18:12 +05:30
|
|
|
end
|
|
|
|
end
|