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/lib/gitlab/kas_spec.rb')
-rw-r--r--spec/lib/gitlab/kas_spec.rb40
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