diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-28 06:09:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-28 06:09:38 +0300 |
commit | f72c02a9a54483a73878ebd770eec931ac64c8c2 (patch) | |
tree | d8695e34de7bf3e4b8250ab29ce2e5ec95c172c9 /spec/services/projects/update_service_spec.rb | |
parent | 9b07a0e87250887c6fc30911f84fd7e885f56245 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/projects/update_service_spec.rb')
-rw-r--r-- | spec/services/projects/update_service_spec.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/services/projects/update_service_spec.rb b/spec/services/projects/update_service_spec.rb index 7b5bf1db030..a5e77104735 100644 --- a/spec/services/projects/update_service_spec.rb +++ b/spec/services/projects/update_service_spec.rb @@ -289,6 +289,42 @@ RSpec.describe Projects::UpdateService do end end + context 'when changing operations feature visibility' do + let(:feature_params) { { operations_access_level: ProjectFeature::DISABLED } } + + it 'does not sync the changes to the related fields' do + result = update_project(project, user, project_feature_attributes: feature_params) + + expect(result).to eq({ status: :success }) + feature = project.project_feature + + expect(feature.operations_access_level).to eq(ProjectFeature::DISABLED) + expect(feature.monitor_access_level).not_to eq(ProjectFeature::DISABLED) + expect(feature.infrastructure_access_level).not_to eq(ProjectFeature::DISABLED) + expect(feature.feature_flags_access_level).not_to eq(ProjectFeature::DISABLED) + expect(feature.environments_access_level).not_to eq(ProjectFeature::DISABLED) + end + + context 'when split_operations_visibility_permissions feature is disabled' do + before do + stub_feature_flags(split_operations_visibility_permissions: false) + end + + it 'syncs the changes to the related fields' do + result = update_project(project, user, project_feature_attributes: feature_params) + + expect(result).to eq({ status: :success }) + feature = project.project_feature + + expect(feature.operations_access_level).to eq(ProjectFeature::DISABLED) + expect(feature.monitor_access_level).to eq(ProjectFeature::DISABLED) + expect(feature.infrastructure_access_level).to eq(ProjectFeature::DISABLED) + expect(feature.feature_flags_access_level).to eq(ProjectFeature::DISABLED) + expect(feature.environments_access_level).to eq(ProjectFeature::DISABLED) + end + end + end + context 'when updating a project that contains container images' do before do stub_container_registry_config(enabled: true) |