diff options
Diffstat (limited to 'spec/models/concerns/deployment_platform_spec.rb')
-rw-r--r-- | spec/models/concerns/deployment_platform_spec.rb | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/spec/models/concerns/deployment_platform_spec.rb b/spec/models/concerns/deployment_platform_spec.rb index f99bf18768f..9164c3a75c5 100644 --- a/spec/models/concerns/deployment_platform_spec.rb +++ b/spec/models/concerns/deployment_platform_spec.rb @@ -13,7 +13,11 @@ describe DeploymentPlatform do end context 'when project is the cluster\'s management project ' do - let!(:cluster_with_management_project) { create(:cluster, :provided_by_user, management_project: project) } + let(:another_project) { create(:project, namespace: project.namespace) } + + let!(:cluster_with_management_project) do + create(:cluster, :provided_by_user, projects: [another_project], management_project: project) + end context 'cluster_management_project feature is enabled' do it 'returns the cluster with management project' do @@ -66,7 +70,11 @@ describe DeploymentPlatform do end context 'when project is the cluster\'s management project ' do - let!(:cluster_with_management_project) { create(:cluster, :provided_by_user, management_project: project) } + let(:another_project) { create(:project, namespace: project.namespace) } + + let!(:cluster_with_management_project) do + create(:cluster, :provided_by_user, projects: [another_project], management_project: project) + end context 'cluster_management_project feature is enabled' do it 'returns the cluster with management project' do @@ -130,5 +138,13 @@ describe DeploymentPlatform do end end end + + context 'when instance has configured kubernetes cluster' do + let!(:instance_cluster) { create(:cluster, :provided_by_user, :instance) } + + it 'returns the Kubernetes platform' do + is_expected.to eq(instance_cluster.platform_kubernetes) + end + end end end |