summaryrefslogtreecommitdiff
path: root/spec/config
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-30 21:09:16 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-30 21:09:16 +0000
commit2ddcd634fc74d894b243694582fdf58cf5fb3c2a (patch)
tree632d56475fca27be71f240dc54e82de1b2d55ce9 /spec/config
parentace0df53d3ed38344b470727d430484d24eeb798 (diff)
downloadgitlab-ce-2ddcd634fc74d894b243694582fdf58cf5fb3c2a.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/config')
-rw-r--r--spec/config/settings_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/config/settings_spec.rb b/spec/config/settings_spec.rb
index ed873478fc9..6525ae653c9 100644
--- a/spec/config/settings_spec.rb
+++ b/spec/config/settings_spec.rb
@@ -134,4 +134,20 @@ RSpec.describe Settings do
end
end
end
+
+ describe '.encrypted' do
+ before do
+ allow(Gitlab::Application.secrets).to receive(:encryped_settings_key_base).and_return(SecureRandom.hex(64))
+ end
+
+ it 'defaults to using the encrypted_settings_key_base for the key' do
+ expect(Gitlab::EncryptedConfiguration).to receive(:new).with(hash_including(base_key: Gitlab::Application.secrets.encrypted_settings_key_base))
+ Settings.encrypted('tmp/tests/test.enc')
+ end
+
+ it 'returns empty encrypted config when a key has not been set' do
+ allow(Gitlab::Application.secrets).to receive(:encrypted_settings_key_base).and_return(nil)
+ expect(Settings.encrypted('tmp/tests/test.enc').read).to be_empty
+ end
+ end
end