diff options
Diffstat (limited to 'spec/workers/pages_domain_verification_cron_worker_spec.rb')
-rw-r--r-- | spec/workers/pages_domain_verification_cron_worker_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/workers/pages_domain_verification_cron_worker_spec.rb b/spec/workers/pages_domain_verification_cron_worker_spec.rb index 186824a444f..3fb86adee11 100644 --- a/spec/workers/pages_domain_verification_cron_worker_spec.rb +++ b/spec/workers/pages_domain_verification_cron_worker_spec.rb @@ -10,6 +10,13 @@ describe PagesDomainVerificationCronWorker do let!(:reverify) { create(:pages_domain, :reverify) } let!(:disabled) { create(:pages_domain, :disabled) } + it 'does nothing if the database is read-only' do + allow(Gitlab::Database).to receive(:read_only?).and_return(true) + expect(PagesDomainVerificationWorker).not_to receive(:perform_async).with(reverify.id) + + worker.perform + end + it 'enqueues a PagesDomainVerificationWorker for domains needing verification' do [reverify, disabled].each do |domain| expect(PagesDomainVerificationWorker).to receive(:perform_async).with(domain.id) |