diff options
Diffstat (limited to 'spec/workers/pages_domain_verification_worker_spec.rb')
-rw-r--r-- | spec/workers/pages_domain_verification_worker_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/workers/pages_domain_verification_worker_spec.rb b/spec/workers/pages_domain_verification_worker_spec.rb index 372fc95ab4a..f51ac1f4323 100644 --- a/spec/workers/pages_domain_verification_worker_spec.rb +++ b/spec/workers/pages_domain_verification_worker_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe PagesDomainVerificationWorker do @@ -6,6 +8,13 @@ describe PagesDomainVerificationWorker do let(:domain) { create(:pages_domain) } describe '#perform' do + it 'does nothing if the database is read-only' do + allow(Gitlab::Database).to receive(:read_only?).and_return(true) + expect(PagesDomain).not_to receive(:find_by).with(id: domain.id) + + worker.perform(domain.id) + end + it 'does nothing for a non-existent domain' do domain.destroy |