diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /spec/initializers/secret_token_spec.rb | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/initializers/secret_token_spec.rb')
-rw-r--r-- | spec/initializers/secret_token_spec.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/spec/initializers/secret_token_spec.rb b/spec/initializers/secret_token_spec.rb index c29f46e7779..b7979144c72 100644 --- a/spec/initializers/secret_token_spec.rb +++ b/spec/initializers/secret_token_spec.rb @@ -7,9 +7,8 @@ describe 'create_tokens' do include StubENV let(:secrets) { ActiveSupport::OrderedOptions.new } - - HEX_KEY = /\h{128}/.freeze - RSA_KEY = /\A-----BEGIN RSA PRIVATE KEY-----\n.+\n-----END RSA PRIVATE KEY-----\n\Z/m.freeze + let(:hex_key) { /\h{128}/.freeze } + let(:rsa_key) { /\A-----BEGIN RSA PRIVATE KEY-----\n.+\n-----END RSA PRIVATE KEY-----\n\Z/m.freeze } before do allow(File).to receive(:write) @@ -35,7 +34,7 @@ describe 'create_tokens' do keys = secrets.values_at(:secret_key_base, :otp_key_base, :db_key_base) expect(keys.uniq).to eq(keys) - expect(keys).to all(match(HEX_KEY)) + expect(keys).to all(match(hex_key)) end it 'generates an RSA key for openid_connect_signing_key' do @@ -44,7 +43,7 @@ describe 'create_tokens' do keys = secrets.values_at(:openid_connect_signing_key) expect(keys.uniq).to eq(keys) - expect(keys).to all(match(RSA_KEY)) + expect(keys).to all(match(rsa_key)) end it 'warns about the secrets to add to secrets.yml' do |