debian-mirror-gitlab/spec/lib/gitlab/external_authorization/config_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
1 KiB
Ruby
Raw Normal View History

2023-04-23 21:23:45 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::ExternalAuthorization::Config, feature_category: :authentication_and_authorization do
it 'allows deploy tokens and keys when external authorization is disabled' do
stub_application_setting(external_authorization_service_enabled: false)
expect(described_class.allow_deploy_tokens_and_deploy_keys?).to be_eql(true)
end
context 'when external authorization is enabled' do
it 'disable deploy tokens and keys' do
stub_application_setting(external_authorization_service_enabled: true)
expect(described_class.allow_deploy_tokens_and_deploy_keys?).to be_eql(false)
end
it "enable deploy tokens and keys when it is explicitly enabled and service url is blank" do
stub_application_setting(external_authorization_service_enabled: true)
stub_application_setting(allow_deploy_tokens_and_keys_with_external_authn: true)
expect(described_class.allow_deploy_tokens_and_deploy_keys?).to be_eql(true)
end
end
end