diff options
author | Tiger <twatson@gitlab.com> | 2019-07-29 05:04:18 +0300 |
---|---|---|
committer | Tiger <twatson@gitlab.com> | 2019-07-29 05:04:18 +0300 |
commit | ce0d74c26b6499062e5dd28f2000c18dfefabf92 (patch) | |
tree | ef9349c052d8ca1c7d5e82744bbf4ec06915efd2 /spec/workers | |
parent | f52e9d55ded0e392bfea5d9bf963615766d5a1a3 (diff) |
Remove unused Clusters::RefreshService
Also removes all logic from ClusterConfigureWorker
and ClusterProjectConfigureWorker, which are also
no longer used.
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/cluster_configure_worker_spec.rb | 71 | ||||
-rw-r--r-- | spec/workers/cluster_project_configure_worker_spec.rb | 14 |
2 files changed, 0 insertions, 85 deletions
diff --git a/spec/workers/cluster_configure_worker_spec.rb b/spec/workers/cluster_configure_worker_spec.rb deleted file mode 100644 index 975088f3ee6..00000000000 --- a/spec/workers/cluster_configure_worker_spec.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe ClusterConfigureWorker, '#perform' do - let(:worker) { described_class.new } - - shared_examples 'configured cluster' do - it 'creates a namespace' do - expect(Clusters::RefreshService).to receive(:create_or_update_namespaces_for_cluster).with(cluster).once - - worker.perform(cluster.id) - end - end - - shared_examples 'unconfigured cluster' do - it 'does not create a namespace' do - expect(Clusters::RefreshService).not_to receive(:create_or_update_namespaces_for_cluster) - - worker.perform(cluster.id) - end - end - - context 'group cluster' do - let(:cluster) { create(:cluster, :group, :provided_by_gcp) } - let(:group) { cluster.group } - - context 'when group has a project' do - let!(:project) { create(:project, group: group) } - - it_behaves_like 'unconfigured cluster' - end - - context 'when group has project in a sub-group' do - let!(:subgroup) { create(:group, parent: group) } - let!(:project) { create(:project, group: subgroup) } - - it_behaves_like 'unconfigured cluster' - end - end - - context 'when provider type is gcp' do - let!(:cluster) { create(:cluster, :project, :provided_by_gcp) } - - it_behaves_like 'configured cluster' - end - - context 'when provider type is user' do - let!(:cluster) { create(:cluster, :project, :provided_by_user) } - - it_behaves_like 'configured cluster' - end - - context 'when cluster is not managed' do - let(:cluster) { create(:cluster, :not_managed) } - - it 'does not configure the cluster' do - expect(Clusters::RefreshService).not_to receive(:create_or_update_namespaces_for_cluster) - - described_class.new.perform(cluster.id) - end - end - - context 'when cluster does not exist' do - it 'does not provision a cluster' do - expect_any_instance_of(Clusters::Gcp::Kubernetes::CreateOrUpdateNamespaceService).not_to receive(:execute) - - described_class.new.perform(123) - end - end -end diff --git a/spec/workers/cluster_project_configure_worker_spec.rb b/spec/workers/cluster_project_configure_worker_spec.rb deleted file mode 100644 index 2ac9d0f61b4..00000000000 --- a/spec/workers/cluster_project_configure_worker_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe ClusterProjectConfigureWorker, '#perform' do - let(:worker) { described_class.new } - let(:cluster) { create(:cluster, :project) } - - it 'configures the cluster' do - expect(Clusters::RefreshService).to receive(:create_or_update_namespaces_for_project) - - described_class.new.perform(cluster.projects.first.id) - end -end |