summaryrefslogtreecommitdiff
path: root/spec/workers
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-11-27 23:55:25 +0900
committerShinya Maeda <shinya@gitlab.com>2017-11-28 20:47:59 +0900
commitf6d9dcf8382a00a5f2ae2100b13774b01f0328bb (patch)
treeff8145f559677bcf284cf68e39a97fba79af98a3 /spec/workers
parentc36d7842da24e6726705199f178c1324c634bdaf (diff)
downloadgitlab-ce-f6d9dcf8382a00a5f2ae2100b13774b01f0328bb.tar.gz
Fix unit tests
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/reactive_caching_worker_spec.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/spec/workers/reactive_caching_worker_spec.rb b/spec/workers/reactive_caching_worker_spec.rb
index 225d3e38542..3da851de067 100644
--- a/spec/workers/reactive_caching_worker_spec.rb
+++ b/spec/workers/reactive_caching_worker_spec.rb
@@ -2,28 +2,27 @@ require 'spec_helper'
describe ReactiveCachingWorker do
let(:service) { project.deployment_platform }
- subject { described_class.new.perform("KubernetesService", service.id) }
describe '#perform' do
- shared_examples 'same behavior between KubernetesService and Platform::Kubernetes' do
+ context 'when user configured kubernetes from Integration > Kubernetes' do
+ let(:project) { create(:kubernetes_project) }
+
it 'calls #exclusively_update_reactive_cache!' do
expect_any_instance_of(KubernetesService).to receive(:exclusively_update_reactive_cache!)
- subject
+ described_class.new.perform("KubernetesService", service.id)
end
end
- context 'when user configured kubernetes from Integration > Kubernetes' do
- let(:project) { create(:kubernetes_project) }
-
- it_behaves_like 'same behavior between KubernetesService and Platform::Kubernetes'
- end
-
context 'when user configured kubernetes from CI/CD > Clusters' do
let!(:cluster) { create(:cluster, :project, :provided_by_gcp) }
let(:project) { cluster.project }
- it_behaves_like 'same behavior between KubernetesService and Platform::Kubernetes'
+ it 'calls #exclusively_update_reactive_cache!' do
+ expect_any_instance_of(Clusters::Platforms::Kubernetes).to receive(:exclusively_update_reactive_cache!)
+
+ described_class.new.perform("Clusters::Platforms::Kubernetes", service.id)
+ end
end
end
end