diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2019-06-24 20:35:12 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-06-24 20:35:12 +0000 |
commit | a7764d0e845db524f2913b6c11c88dfd121ec522 (patch) | |
tree | 8e84742f692e05e56102b7cfd7d20462ba1c8305 /spec/models | |
parent | bf8f5b8f446c504ca13ef2a8cf28cc3faeaf3253 (diff) | |
download | gitlab-ce-a7764d0e845db524f2913b6c11c88dfd121ec522.tar.gz |
Renew Let's Encrypt certificates
Add index for pages domain ssl auto renewal
Add PagesDomain.needs_ssl_renewal scope
Add cron worker for ssl renewal
Add worker for ssl renewal
Add pages ssl renewal worker queues settings
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/pages_domain_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/models/pages_domain_spec.rb b/spec/models/pages_domain_spec.rb index 4fb7b71a3c7..661957cf08b 100644 --- a/spec/models/pages_domain_spec.rb +++ b/spec/models/pages_domain_spec.rb @@ -479,4 +479,30 @@ describe PagesDomain do end end end + + describe '.need_auto_ssl_renewal' do + subject { described_class.need_auto_ssl_renewal } + + let!(:domain_with_user_provided_certificate) { create(:pages_domain) } + let!(:domain_with_expired_user_provided_certificate) do + create(:pages_domain, :with_expired_certificate) + end + let!(:domain_with_user_provided_certificate_and_auto_ssl) do + create(:pages_domain, auto_ssl_enabled: true) + end + + let!(:domain_with_gitlab_provided_certificate) { create(:pages_domain, :letsencrypt) } + let!(:domain_with_expired_gitlab_provided_certificate) do + create(:pages_domain, :letsencrypt, :with_expired_certificate) + end + + it 'contains only domains needing verification' do + is_expected.to( + contain_exactly( + domain_with_user_provided_certificate_and_auto_ssl, + domain_with_expired_gitlab_provided_certificate + ) + ) + end + end end |