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:
Diffstat (limited to 'spec/services/application_settings/update_service_spec.rb')
-rw-r--r--spec/services/application_settings/update_service_spec.rb35
1 files changed, 0 insertions, 35 deletions
diff --git a/spec/services/application_settings/update_service_spec.rb b/spec/services/application_settings/update_service_spec.rb
index 258e5635113..a4a733eff77 100644
--- a/spec/services/application_settings/update_service_spec.rb
+++ b/spec/services/application_settings/update_service_spec.rb
@@ -1,8 +1,6 @@
require 'spec_helper'
describe ApplicationSettings::UpdateService do
- include ExternalAuthorizationServiceHelpers
-
let(:application_settings) { create(:application_setting) }
let(:admin) { create(:user, :admin) }
let(:params) { {} }
@@ -145,37 +143,4 @@ describe ApplicationSettings::UpdateService do
end
end
end
-
- context 'when external authorization is enabled' do
- before do
- enable_external_authorization_service_check
- 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 }
-
- described_class.new(application_settings, admin, { external_authorization_service_default_label: 'new-label' }).execute
-
- expect(application_settings.errors[:external_authorization_service_default_label]).to be_present
- end
-
- it 'saves the setting when the user has access to the label' do
- expect(::Gitlab::ExternalAuthorization)
- .to receive(:access_allowed?).with(admin, 'new-label') { true }
-
- described_class.new(application_settings, admin, { external_authorization_service_default_label: 'new-label' }).execute
-
- # Read the attribute directly to avoid the stub from
- # `enable_external_authorization_service_check`
- expect(application_settings[:external_authorization_service_default_label]).to eq('new-label')
- end
-
- it 'does not validate the label if it was not passed' do
- expect(::Gitlab::ExternalAuthorization)
- .not_to receive(:access_allowed?)
-
- described_class.new(application_settings, admin, { home_page_url: 'http://foo.bar' }).execute
- end
- end
end