From 1c18f15c2b8f8f11f8a82486648bb37abd4d9781 Mon Sep 17 00:00:00 2001 From: Lee Tickett <ltickett@gitlab.com> Date: Wed, 6 Dec 2023 12:06:49 +0000 Subject: [PATCH] Fix project templates at instance level Changelog: fixed --- app/models/project_feature.rb | 2 +- ee/spec/models/ee/user_spec.rb | 22 ++++------------------ 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/app/models/project_feature.rb b/app/models/project_feature.rb index 36f1e09b2bad6..de2ecc3898af6 100644 --- a/app/models/project_feature.rb +++ b/app/models/project_feature.rb @@ -29,7 +29,7 @@ class ProjectFeature < ApplicationRecord model_experiments ].freeze - EXPORTABLE_FEATURES = (FEATURES - [:security_and_compliance, :pages]).freeze + EXPORTABLE_FEATURES = (FEATURES - [:security_and_compliance, :pages, :metrics_dashboard]).freeze set_available_features(FEATURES) diff --git a/ee/spec/models/ee/user_spec.rb b/ee/spec/models/ee/user_spec.rb index 5ce5f1253aba0..926f5997fb9b6 100644 --- a/ee/spec/models/ee/user_spec.rb +++ b/ee/spec/models/ee/user_spec.rb @@ -812,6 +812,10 @@ expect(user.available_custom_project_templates).to include public_project end + it 'returns internal projects' do + expect(user.available_custom_project_templates).to include internal_project + end + context 'returns private projects if user' do it 'is a member of the project' do expect(user.available_custom_project_templates).not_to include private_project @@ -830,24 +834,6 @@ end end - context 'returns internal projects if user' do - it 'is a member of the project' do - expect(user.available_custom_project_templates).not_to include internal_project - - internal_project.add_developer(user) - - expect(user.available_custom_project_templates).to include internal_project - end - - it 'is a member of the group' do - expect(user.available_custom_project_templates).not_to include internal_project - - group.add_developer(user) - - expect(user.available_custom_project_templates).to include internal_project - end - end - it 'allows to search available project templates by name' do projects = user.available_custom_project_templates(search: 'publi') -- GitLab