diff options
Diffstat (limited to 'spec/workers/reactive_caching_worker_spec.rb')
-rw-r--r-- | spec/workers/reactive_caching_worker_spec.rb | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/spec/workers/reactive_caching_worker_spec.rb b/spec/workers/reactive_caching_worker_spec.rb index 5f4453c15d6..3da851de067 100644 --- a/spec/workers/reactive_caching_worker_spec.rb +++ b/spec/workers/reactive_caching_worker_spec.rb @@ -1,15 +1,28 @@ require 'spec_helper' describe ReactiveCachingWorker do - let(:project) { create(:kubernetes_project) } - let(:service) { project.deployment_service } - subject { described_class.new.perform("KubernetesService", service.id) } + let(:service) { project.deployment_platform } describe '#perform' do - it 'calls #exclusively_update_reactive_cache!' do - expect_any_instance_of(KubernetesService).to receive(:exclusively_update_reactive_cache!) + context 'when user configured kubernetes from Integration > Kubernetes' do + let(:project) { create(:kubernetes_project) } - subject + it 'calls #exclusively_update_reactive_cache!' do + expect_any_instance_of(KubernetesService).to receive(:exclusively_update_reactive_cache!) + + described_class.new.perform("KubernetesService", service.id) + end + end + + context 'when user configured kubernetes from CI/CD > Clusters' do + let!(:cluster) { create(:cluster, :project, :provided_by_gcp) } + let(:project) { cluster.project } + + 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 |