Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb')
-rw-r--r--spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb59
1 files changed, 0 insertions, 59 deletions
diff --git a/spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb b/spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb
deleted file mode 100644
index b753b84ae55..00000000000
--- a/spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe MigrateManagedClustersWithNoTokenToUnmanaged do
- let(:cluster_type) { 'project_type' }
- let(:created_at) { Date.new(2018, 11, 1).midnight }
-
- let!(:cluster) do
- table(:clusters).create!(
- name: 'cluster',
- cluster_type: described_class::Cluster.cluster_types[cluster_type],
- managed: true,
- created_at: created_at
- )
- end
-
- let!(:kubernetes_namespace) do
- table(:clusters_kubernetes_namespaces).create!(
- cluster_id: cluster.id,
- namespace: 'namespace'
- )
- end
-
- it 'marks the cluster as unmanaged' do
- migrate!
- expect(cluster.reload).not_to be_managed
- end
-
- context 'cluster is not project type' do
- let(:cluster_type) { 'group_type' }
-
- it 'does not update the cluster' do
- migrate!
- expect(cluster.reload).to be_managed
- end
- end
-
- context 'kubernetes namespace has a service account token' do
- before do
- kubernetes_namespace.update!(encrypted_service_account_token: "TOKEN")
- end
-
- it 'does not update the cluster' do
- migrate!
- expect(cluster.reload).to be_managed
- end
- end
-
- context 'cluster was created after the cutoff' do
- let(:created_at) { Date.new(2019, 1, 1).midnight }
-
- it 'does not update the cluster' do
- migrate!
- expect(cluster.reload).to be_managed
- end
- end
-end