diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2019-04-27 07:38:01 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-04-27 07:38:01 +0300 |
commit | db6989ddb0dc1dc630803ea3748542779b5f9090 (patch) | |
tree | e582d413bcfb26195ec10543bb604fc802c38ae7 /spec/models/application_setting_spec.rb | |
parent | 22ed1ba34b949f0c0619ea0a94de89ca987a1222 (diff) |
Add Let's Encrypt application settings
Store Let's Encrypt account email in application settings
Also add explicit terms of service consent
Diffstat (limited to 'spec/models/application_setting_spec.rb')
-rw-r--r-- | spec/models/application_setting_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index c7d7dbac736..f8dc1541dd3 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -31,6 +31,20 @@ describe ApplicationSetting do it { is_expected.to allow_value("dev.gitlab.com").for(:commit_email_hostname) } it { is_expected.not_to allow_value("@dev.gitlab").for(:commit_email_hostname) } + it { is_expected.to allow_value("myemail@gitlab.com").for(:lets_encrypt_notification_email) } + it { is_expected.to allow_value(nil).for(:lets_encrypt_notification_email) } + it { is_expected.not_to allow_value("notanemail").for(:lets_encrypt_notification_email) } + it { is_expected.not_to allow_value("myemail@example.com").for(:lets_encrypt_notification_email) } + it { is_expected.to allow_value("myemail@test.example.com").for(:lets_encrypt_notification_email) } + + context "when user accepted let's encrypt terms of service" do + before do + setting.update(lets_encrypt_terms_of_service_accepted: true) + end + + it { is_expected.not_to allow_value(nil).for(:lets_encrypt_notification_email) } + end + describe 'default_artifacts_expire_in' do it 'sets an error if it cannot parse' do setting.update(default_artifacts_expire_in: 'a') |