diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2019-06-24 23:35:12 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-06-24 23:35:12 +0300 |
commit | a7764d0e845db524f2913b6c11c88dfd121ec522 (patch) | |
tree | 8e84742f692e05e56102b7cfd7d20462ba1c8305 /spec/workers/pages_domain_ssl_renewal_worker_spec.rb | |
parent | bf8f5b8f446c504ca13ef2a8cf28cc3faeaf3253 (diff) |
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/workers/pages_domain_ssl_renewal_worker_spec.rb')
-rw-r--r-- | spec/workers/pages_domain_ssl_renewal_worker_spec.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/workers/pages_domain_ssl_renewal_worker_spec.rb b/spec/workers/pages_domain_ssl_renewal_worker_spec.rb new file mode 100644 index 00000000000..a3d33de1b40 --- /dev/null +++ b/spec/workers/pages_domain_ssl_renewal_worker_spec.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe PagesDomainSslRenewalWorker do + include LetsEncryptHelpers + + subject(:worker) { described_class.new } + + let(:domain) { create(:pages_domain) } + + before do + stub_lets_encrypt_settings + end + + describe '#perform' do + it 'delegates to ObtainLetsEncryptCertificateService' do + service = double(:service) + expect(::PagesDomains::ObtainLetsEncryptCertificateService).to receive(:new).with(domain).and_return(service) + expect(service).to receive(:execute) + + worker.perform(domain.id) + end + + context 'when domain was deleted' do + before do + domain.destroy! + end + + it 'does nothing' do + expect(::PagesDomains::ObtainLetsEncryptCertificateService).not_to receive(:new) + end + end + end +end |