summaryrefslogtreecommitdiff
path: root/spec/services/clusters
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2018-10-23 16:51:29 +1300
committerThong Kuah <tkuah@gitlab.com>2018-11-08 23:14:06 +1300
commit54e8ff0f218371262d85989b3e08fd1a22958717 (patch)
tree5927446b7be5f1b0cb298d215dba737a5f630c23 /spec/services/clusters
parent76991929855f2a9f801fa16f80ccebad28853dd8 (diff)
downloadgitlab-ce-54e8ff0f218371262d85989b3e08fd1a22958717.tar.gz
Extend clusters_controller for group type clusters
- Add pages javascripts to intialize clusters for group pages - Move specs asserting gcp specific validations from controller into UpdateService spec - Also teach Clusters::ApplicationController about groups
Diffstat (limited to 'spec/services/clusters')
-rw-r--r--spec/services/clusters/update_service_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/services/clusters/update_service_spec.rb b/spec/services/clusters/update_service_spec.rb
index a1b20c61116..7a777260be1 100644
--- a/spec/services/clusters/update_service_spec.rb
+++ b/spec/services/clusters/update_service_spec.rb
@@ -62,5 +62,32 @@ describe Clusters::UpdateService do
expect(cluster.errors[:"platform_kubernetes.namespace"]).to be_present
end
end
+
+ context 'when cluster is provided by GCP' do
+ let(:cluster) { create(:cluster, :project, :provided_by_gcp) }
+
+ let(:params) do
+ {
+ name: 'my-new-name'
+ }
+ end
+
+ it "does not change cluster name" do
+ is_expected.to eq(false)
+
+ cluster.reload
+ expect(cluster.name).to eq('test-cluster')
+ end
+
+ context 'when cluster is being created' do
+ let(:cluster) { create(:cluster, :providing_by_gcp) }
+
+ it "rejects changes" do
+ is_expected.to eq(false)
+
+ expect(cluster.errors.full_messages).to include('cannot modify during creation')
+ end
+ end
+ end
end
end