summaryrefslogtreecommitdiff
path: root/spec/workers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-10 18:07:43 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-10 18:07:43 +0000
commit6f0f893bd87535b61e0ecb1ce069eaa7fcb9e5be (patch)
tree8af92b29c838e9af2fd70f9a4a2314a08f4af922 /spec/workers
parent8b1228b0d409d7751f01d9fb72ebfbbf62399486 (diff)
downloadgitlab-ce-6f0f893bd87535b61e0ecb1ce069eaa7fcb9e5be.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/self_monitoring_project_create_worker_spec.rb16
-rw-r--r--spec/workers/self_monitoring_project_delete_worker_spec.rb19
2 files changed, 21 insertions, 14 deletions
diff --git a/spec/workers/self_monitoring_project_create_worker_spec.rb b/spec/workers/self_monitoring_project_create_worker_spec.rb
index 75c4f5d49d1..00c288bdc46 100644
--- a/spec/workers/self_monitoring_project_create_worker_spec.rb
+++ b/spec/workers/self_monitoring_project_create_worker_spec.rb
@@ -7,22 +7,10 @@ describe SelfMonitoringProjectCreateWorker do
let(:service_class) { Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService }
let(:service) { instance_double(service_class) }
- before do
- allow(service_class).to receive(:new) { service }
- end
-
- it 'runs the SelfMonitoring::Project::CreateService' do
- expect(service).to receive(:execute)
-
- subject.perform
- end
+ it_behaves_like 'executes service'
end
describe '.in_progress?', :clean_gitlab_redis_shared_state do
- it 'returns in_progress when job is enqueued' do
- jid = described_class.perform_async
-
- expect(described_class.in_progress?(jid)).to eq(true)
- end
+ it_behaves_like 'returns in_progress based on Sidekiq::Status'
end
end
diff --git a/spec/workers/self_monitoring_project_delete_worker_spec.rb b/spec/workers/self_monitoring_project_delete_worker_spec.rb
new file mode 100644
index 00000000000..3685c73513e
--- /dev/null
+++ b/spec/workers/self_monitoring_project_delete_worker_spec.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe SelfMonitoringProjectDeleteWorker do
+ let_it_be(:jid) { 'b5b28910d97563e58c2fe55f' }
+ let_it_be(:data_key) { "self_monitoring_delete_result:#{jid}" }
+
+ describe '#perform' do
+ let(:service_class) { Gitlab::DatabaseImporters::SelfMonitoring::Project::DeleteService }
+ let(:service) { instance_double(service_class) }
+
+ it_behaves_like 'executes service'
+ end
+
+ describe '.status', :clean_gitlab_redis_shared_state do
+ it_behaves_like 'returns in_progress based on Sidekiq::Status'
+ end
+end