diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-21 03:09:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-21 03:09:28 +0300 |
commit | b1031060f00cdb201cf8d790c6ec6421860c30f3 (patch) | |
tree | 44b572f9df4a5696d4378bc7848f19ac79e02cbd /spec/workers/concerns | |
parent | cfd505b1984183857fcfeab259c5a38791205914 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/concerns')
-rw-r--r-- | spec/workers/concerns/application_worker_spec.rb | 12 | ||||
-rw-r--r-- | spec/workers/concerns/worker_context_spec.rb | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/spec/workers/concerns/application_worker_spec.rb b/spec/workers/concerns/application_worker_spec.rb index ac4e4a682c8..af038c81b9e 100644 --- a/spec/workers/concerns/application_worker_spec.rb +++ b/spec/workers/concerns/application_worker_spec.rb @@ -248,6 +248,10 @@ RSpec.describe ApplicationWorker do end describe '.perform_async' do + before do + stub_const(worker.name, worker) + end + shared_examples_for 'worker utilizes load balancing capabilities' do |data_consistency| before do worker.data_consistency(data_consistency) @@ -282,6 +286,10 @@ RSpec.describe ApplicationWorker do end describe '.bulk_perform_async' do + before do + stub_const(worker.name, worker) + end + it 'enqueues jobs in bulk' do Sidekiq::Testing.fake! do worker.bulk_perform_async([['Foo', [1]], ['Foo', [2]]]) @@ -293,6 +301,10 @@ RSpec.describe ApplicationWorker do end describe '.bulk_perform_in' do + before do + stub_const(worker.name, worker) + end + context 'when delay is valid' do it 'correctly schedules jobs' do Sidekiq::Testing.fake! do diff --git a/spec/workers/concerns/worker_context_spec.rb b/spec/workers/concerns/worker_context_spec.rb index ebdb752d900..80b427b2b42 100644 --- a/spec/workers/concerns/worker_context_spec.rb +++ b/spec/workers/concerns/worker_context_spec.rb @@ -13,6 +13,10 @@ RSpec.describe WorkerContext do end end + before do + stub_const(worker.name, worker) + end + describe '.worker_context' do it 'allows modifying the context for the entire worker' do worker.worker_context(user: build_stubbed(:user)) |