diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-05 12:08:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-05 12:08:43 +0300 |
commit | 26384c9a61da9922b8fa4b8351d4e42d51661b37 (patch) | |
tree | ef3decbed644db3c97dcdbb5b71d4ade77f3155d /spec/workers | |
parent | 79cbe31b18159ea394c6f6e3027c1dc69bdabb75 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/cluster_configure_istio_worker_spec.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/workers/cluster_configure_istio_worker_spec.rb b/spec/workers/cluster_configure_istio_worker_spec.rb new file mode 100644 index 00000000000..0f02d428ced --- /dev/null +++ b/spec/workers/cluster_configure_istio_worker_spec.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe ClusterConfigureIstioWorker do + describe '#perform' do + shared_examples 'configure istio service' do + it 'configures istio' do + expect_any_instance_of(Clusters::Kubernetes::ConfigureIstioIngressService).to receive(:execute) + + described_class.new.perform(cluster.id) + end + end + + context 'when provider type is gcp' do + let(:cluster) { create(:cluster, :project, :provided_by_gcp) } + + it_behaves_like 'configure istio service' + end + + context 'when provider type is aws' do + let(:cluster) { create(:cluster, :project, :provided_by_aws) } + + it_behaves_like 'configure istio service' + end + + context 'when provider type is user' do + let(:cluster) { create(:cluster, :project, :provided_by_user) } + + it_behaves_like 'configure istio service' + end + + context 'when cluster does not exist' do + it 'does not provision a cluster' do + expect_any_instance_of(Clusters::Kubernetes::ConfigureIstioIngressService).not_to receive(:execute) + + described_class.new.perform(123) + end + end + end +end |