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:
authorThong Kuah <tkuah@gitlab.com>2018-11-02 10:53:50 +0300
committerThong Kuah <tkuah@gitlab.com>2018-11-08 13:26:03 +0300
commitfc0b8252dffb686e07ef0b6f0dc72c2796c81a42 (patch)
tree79d2ce8f9cf775b4dc8bb202fe94b1e98062649f /spec/services/clusters/applications
parent2109cb996aaacc58f16525bae64138b8dfa495f1 (diff)
Do not allow applications for group clusters
These applications will need further work in future issues to enable them to work with groups of projects.
Diffstat (limited to 'spec/services/clusters/applications')
-rw-r--r--spec/services/clusters/applications/create_service_spec.rb42
1 files changed, 34 insertions, 8 deletions
diff --git a/spec/services/clusters/applications/create_service_spec.rb b/spec/services/clusters/applications/create_service_spec.rb
index a9985133b93..0bd7719345e 100644
--- a/spec/services/clusters/applications/create_service_spec.rb
+++ b/spec/services/clusters/applications/create_service_spec.rb
@@ -60,14 +60,6 @@ describe Clusters::Applications::CreateService do
end
end
- context 'invalid application' do
- let(:params) { { application: 'non-existent' } }
-
- it 'raises an error' do
- expect { subject }.to raise_error(Clusters::Applications::CreateService::InvalidApplicationError)
- end
- end
-
context 'knative application' do
let(:params) do
{
@@ -100,5 +92,39 @@ describe Clusters::Applications::CreateService do
expect { subject }.to raise_error(Clusters::Applications::CreateService::InvalidApplicationError)
end
end
+
+ context 'group cluster' do
+ let(:cluster) { create(:cluster, :provided_by_gcp, :group) }
+
+ using RSpec::Parameterized::TableSyntax
+
+ before do
+ allow_any_instance_of(Clusters::Applications::ScheduleInstallationService).to receive(:execute)
+ end
+
+ where(:application, :association, :allowed) do
+ 'helm' | :application_helm | true
+ 'ingress' | :application_ingress | true
+ 'runner' | :application_runner | false
+ 'jupyter' | :application_jupyter | false
+ 'prometheus' | :application_prometheus | false
+ end
+
+ with_them do
+ let(:params) { { application: application } }
+
+ it 'executes for each application' do
+ if allowed
+ expect do
+ subject
+
+ cluster.reload
+ end.to change(cluster, association)
+ else
+ expect { subject }.to raise_error(Clusters::Applications::CreateService::InvalidApplicationError)
+ end
+ end
+ end
+ end
end
end