2016-12-16 23:09:50 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe ReactiveCachingWorker do
|
2017-11-27 08:35:16 -05:00
|
|
|
let(:service) { project.deployment_platform }
|
2016-12-16 23:09:50 -05:00
|
|
|
|
|
|
|
describe '#perform' do
|
2017-11-27 09:55:25 -05:00
|
|
|
context 'when user configured kubernetes from Integration > Kubernetes' do
|
|
|
|
let(:project) { create(:kubernetes_project) }
|
|
|
|
|
2017-11-27 07:48:54 -05:00
|
|
|
it 'calls #exclusively_update_reactive_cache!' do
|
|
|
|
expect_any_instance_of(KubernetesService).to receive(:exclusively_update_reactive_cache!)
|
2016-12-16 23:09:50 -05:00
|
|
|
|
2017-11-27 09:55:25 -05:00
|
|
|
described_class.new.perform("KubernetesService", service.id)
|
2017-11-27 07:48:54 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when user configured kubernetes from CI/CD > Clusters' do
|
|
|
|
let!(:cluster) { create(:cluster, :project, :provided_by_gcp) }
|
|
|
|
let(:project) { cluster.project }
|
|
|
|
|
2017-11-27 09:55:25 -05:00
|
|
|
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
|
2016-12-16 23:09:50 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|