summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2019-08-22 20:20:23 +0200
committerRobert Schilling <rschilling@student.tugraz.at>2019-08-22 20:20:23 +0200
commitf56c2191a10667783d488eb3415ac2ba2b3f06a3 (patch)
tree1a2e023f4326e06fc1cdb44811bba47813d518b6
parentcc18c332e0b99f7b674a56a5be59e8b118c81289 (diff)
downloadgitlab-ce-66443-unrecoverable-configuration-loop-in-external-auth-control.tar.gz
-rw-r--r--spec/services/application_settings/update_service_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/services/application_settings/update_service_spec.rb b/spec/services/application_settings/update_service_spec.rb
index 235fce92fc8..ab06c1a1209 100644
--- a/spec/services/application_settings/update_service_spec.rb
+++ b/spec/services/application_settings/update_service_spec.rb
@@ -207,6 +207,18 @@ describe ApplicationSettings::UpdateService do
described_class.new(application_settings, admin, { external_authorization_service_enabled: false }).execute
end
+ it 'does validate labels if external authorization gets enabled ' do
+ expect_any_instance_of(described_class).to receive(:validate_classification_label)
+
+ described_class.new(application_settings, admin, { external_authorization_service_enabled: true }).execute
+ end
+
+ it 'does validate labels if external authorization is left unchanged' do
+ expect_any_instance_of(described_class).to receive(:validate_classification_label)
+
+ described_class.new(application_settings, admin, { external_authorization_service_default_label: 'new-label' }).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 }