diff options
Diffstat (limited to 'spec/workers/x509_certificate_revoke_worker_spec.rb')
-rw-r--r-- | spec/workers/x509_certificate_revoke_worker_spec.rb | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/spec/workers/x509_certificate_revoke_worker_spec.rb b/spec/workers/x509_certificate_revoke_worker_spec.rb index badeff25b34..508feecbcbe 100644 --- a/spec/workers/x509_certificate_revoke_worker_spec.rb +++ b/spec/workers/x509_certificate_revoke_worker_spec.rb @@ -5,31 +5,14 @@ require 'spec_helper' RSpec.describe X509CertificateRevokeWorker, feature_category: :source_code_management do describe '#perform' do context 'with a revoked certificate' do - subject { described_class.new } + subject { described_class.new.perform(job_args) } let(:x509_certificate) { create(:x509_certificate, certificate_status: :revoked) } let(:job_args) { x509_certificate.id } - include_examples 'an idempotent worker' do - it 'executes the revoke service' do - spy_service = X509CertificateRevokeService.new - - allow(X509CertificateRevokeService).to receive(:new) { spy_service } - - expect(spy_service).to receive(:execute) - .exactly(IdempotentWorkerHelper::WORKER_EXEC_TIMES).times - .with(x509_certificate) - .and_call_original - - subject - end - end + it_behaves_like 'an idempotent worker' it 'executes the revoke service' do - spy_service = X509CertificateRevokeService.new - - allow(X509CertificateRevokeService).to receive(:new) { spy_service } - expect_next_instance_of(X509CertificateRevokeService) do |service| expect(service).to receive(:execute).with(x509_certificate) end |