diff options
Diffstat (limited to 'spec/workers/concerns/waitable_worker_spec.rb')
-rw-r--r-- | spec/workers/concerns/waitable_worker_spec.rb | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/spec/workers/concerns/waitable_worker_spec.rb b/spec/workers/concerns/waitable_worker_spec.rb deleted file mode 100644 index 737424ffd8c..00000000000 --- a/spec/workers/concerns/waitable_worker_spec.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe WaitableWorker do - let(:worker) do - Class.new do - def self.name - 'Gitlab::Foo::Bar::DummyWorker' - end - - cattr_accessor(:counter) { 0 } - - include ApplicationWorker - prepend WaitableWorker - - def perform(count = 0) - self.class.counter += count - end - end - end - - subject(:job) { worker.new } - - describe '#perform' do - shared_examples 'perform' do - it 'notifies the JobWaiter when done if the key is provided' do - key = Gitlab::JobWaiter.new.key - expect(Gitlab::JobWaiter).to receive(:notify).with(key, job.jid) - - job.perform(*args, key) - end - - it 'does not notify the JobWaiter when done if no key is provided' do - expect(Gitlab::JobWaiter).not_to receive(:notify) - - job.perform(*args) - end - end - - context 'when the worker takes arguments' do - let(:args) { [1] } - - it_behaves_like 'perform' - end - - context 'when the worker takes no arguments' do - let(:args) { [] } - - it_behaves_like 'perform' - end - end -end |