From 4393064893ea955cff1874ca929e771442edbe4c Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Thu, 21 Jan 2021 09:29:31 +0100 Subject: [PATCH] Maintenance: Speed up Zendesk import spec by mocking retry cycle sleep. --- .../unit/import/zendesk/sub_sequence/base_examples.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/lib/sequencer/unit/import/zendesk/sub_sequence/base_examples.rb b/spec/lib/sequencer/unit/import/zendesk/sub_sequence/base_examples.rb index cf063002c..0dc462250 100644 --- a/spec/lib/sequencer/unit/import/zendesk/sub_sequence/base_examples.rb +++ b/spec/lib/sequencer/unit/import/zendesk/sub_sequence/base_examples.rb @@ -62,7 +62,11 @@ RSpec.shared_examples 'Sequencer::Unit::Import::Zendesk::SubSequence::Base' do before { allow(response_obj).to receive(:status).and_return(403) } it 'does not rescue the resulting exception' do - expect { process(params) }.to raise_error(api_error) + expect do + process(params) do |unit| + allow(unit).to receive(:sleep) # stub out this method to speed up retry cycle + end + end.to raise_error(api_error) end end end