gitlab-org--gitlab-foss/spec/workers/reactive_caching_worker_spec.rb

29 lines
968 B
Ruby
Raw Normal View History

require 'spec_helper'
describe ReactiveCachingWorker do
let(:service) { project.deployment_platform }
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) }
it 'calls #exclusively_update_reactive_cache!' do
expect_any_instance_of(KubernetesService).to receive(:exclusively_update_reactive_cache!)
2017-11-27 09:55:25 -05:00
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 }
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
end
end
end