diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/models/application_setting_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/models/application_setting_spec.rb')
-rw-r--r-- | spec/models/application_setting_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index fb702d10a42..efe62a1d086 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -72,6 +72,7 @@ RSpec.describe ApplicationSetting do it { is_expected.not_to allow_value(nil).for(:push_event_activities_limit) } it { is_expected.to validate_numericality_of(:container_registry_delete_tags_service_timeout).only_integer.is_greater_than_or_equal_to(0) } + it { is_expected.to validate_numericality_of(:container_registry_expiration_policies_worker_capacity).only_integer.is_greater_than_or_equal_to(0) } it { is_expected.to validate_numericality_of(:snippet_size_limit).only_integer.is_greater_than(0) } it { is_expected.to validate_numericality_of(:wiki_page_max_content_bytes).only_integer.is_greater_than_or_equal_to(1024) } @@ -647,6 +648,37 @@ RSpec.describe ApplicationSetting do end end end + + describe '#ci_jwt_signing_key' do + it { is_expected.not_to allow_value('').for(:ci_jwt_signing_key) } + it { is_expected.not_to allow_value('invalid RSA key').for(:ci_jwt_signing_key) } + it { is_expected.to allow_value(nil).for(:ci_jwt_signing_key) } + it { is_expected.to allow_value(OpenSSL::PKey::RSA.new(1024).to_pem).for(:ci_jwt_signing_key) } + + it 'is encrypted' do + subject.ci_jwt_signing_key = OpenSSL::PKey::RSA.new(1024).to_pem + + aggregate_failures do + expect(subject.encrypted_ci_jwt_signing_key).to be_present + expect(subject.encrypted_ci_jwt_signing_key_iv).to be_present + expect(subject.encrypted_ci_jwt_signing_key).not_to eq(subject.ci_jwt_signing_key) + end + end + end + + describe '#cloud_license_auth_token' do + it { is_expected.to allow_value(nil).for(:cloud_license_auth_token) } + + it 'is encrypted' do + subject.cloud_license_auth_token = 'token-from-customers-dot' + + aggregate_failures do + expect(subject.encrypted_cloud_license_auth_token).to be_present + expect(subject.encrypted_cloud_license_auth_token_iv).to be_present + expect(subject.encrypted_cloud_license_auth_token).not_to eq(subject.cloud_license_auth_token) + end + end + end end context 'static objects external storage' do |