diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /spec/lib/gitlab/kas_spec.rb | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'spec/lib/gitlab/kas_spec.rb')
-rw-r--r-- | spec/lib/gitlab/kas_spec.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/lib/gitlab/kas_spec.rb b/spec/lib/gitlab/kas_spec.rb index 01ced407883..e323f76b42e 100644 --- a/spec/lib/gitlab/kas_spec.rb +++ b/spec/lib/gitlab/kas_spec.rb @@ -33,6 +33,46 @@ RSpec.describe Gitlab::Kas do end end + describe '.enabled?' do + before do + allow(Gitlab).to receive(:config).and_return(gitlab_config) + end + + subject { described_class.enabled? } + + context 'gitlab_config is not enabled' do + let(:gitlab_config) { { 'gitlab_kas' => { 'enabled' => false } } } + + it { is_expected.to be_falsey } + end + + context 'gitlab_config is enabled' do + let(:gitlab_config) { { 'gitlab_kas' => { 'enabled' => true } } } + + it { is_expected.to be_truthy } + end + + context 'enabled is unset' do + let(:gitlab_config) { { 'gitlab_kas' => {} } } + + it { is_expected.to be_falsey } + end + end + + describe '.external_url' do + it 'returns gitlab_kas external_url config' do + expect(described_class.external_url).to eq(Gitlab.config.gitlab_kas.external_url) + end + end + + describe '.version' do + it 'returns gitlab_kas version config' do + version_file = Rails.root.join(described_class::VERSION_FILE) + + expect(described_class.version).to eq(version_file.read.chomp) + end + end + describe '.ensure_secret!' do context 'secret file exists' do before do |