debian-mirror-gitlab/spec/workers/reactive_caching_worker_spec.rb

29 lines
968 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require 'spec_helper'
describe ReactiveCachingWorker do
2018-03-17 18:26:18 +05:30
let(:service) { project.deployment_platform }
2017-08-17 22:00:37 +05:30
describe '#perform' do
2018-03-17 18:26:18 +05:30
context 'when user configured kubernetes from Integration > Kubernetes' do
let(:project) { create(:kubernetes_project) }
2017-08-17 22:00:37 +05:30
2018-03-17 18:26:18 +05:30
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
2017-08-17 22:00:37 +05:30
end
end
end