Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2019-08-22 20:05:43 +0300
committerRobert Schilling <rschilling@student.tugraz.at>2019-08-22 20:39:11 +0300
commitcc18c332e0b99f7b674a56a5be59e8b118c81289 (patch)
tree7bc8ead15d93201717f036788c87e3ddfca960e5 /spec/services/application_settings
parent30f302d2beb78af896213850c570792ce3d88b97 (diff)
Add test, reduce complexity
Diffstat (limited to 'spec/services/application_settings')
-rw-r--r--spec/services/application_settings/update_service_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/services/application_settings/update_service_spec.rb b/spec/services/application_settings/update_service_spec.rb
index adb5219d691..235fce92fc8 100644
--- a/spec/services/application_settings/update_service_spec.rb
+++ b/spec/services/application_settings/update_service_spec.rb
@@ -201,6 +201,12 @@ describe ApplicationSettings::UpdateService do
enable_external_authorization_service_check
end
+ it 'does not validate labels if external authorization gets disabled' do
+ expect_any_instance_of(described_class).not_to receive(:validate_classification_label)
+
+ described_class.new(application_settings, admin, { external_authorization_service_enabled: false }).execute
+ end
+
it 'does not save the settings with an error if the service denies access' do
expect(::Gitlab::ExternalAuthorization)
.to receive(:access_allowed?).with(admin, 'new-label') { false }