diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2019-01-23 10:28:19 -0600 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-02-04 11:43:34 -0600 |
commit | 8ff73614a1466ffc39e4464462719e7456c03e29 (patch) | |
tree | 8573da7dc5ea258c1aa7bd373b757b4b0e6cf996 /spec/controllers/groups | |
parent | 280b6f6f8d038c4c28b32c5965e8a052adf4a052 (diff) | |
download | gitlab-ce-8ff73614a1466ffc39e4464462719e7456c03e29.tar.gz |
Moves domain setting to Cluster setting
Changes domain field to be on the Cluster page show, removing it from
Auto DevOps setting. Also injects the new environment variable
KUBE_INGRESS_BASE_DOMAIN into kubernetes#predefined_variables.
Migration to move the information from ProjectAutoDevops#domain
to Clusters::Cluster#domain. As well as necessary modifications to qa
selectors
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52363
Diffstat (limited to 'spec/controllers/groups')
-rw-r--r-- | spec/controllers/groups/clusters_controller_spec.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/spec/controllers/groups/clusters_controller_spec.rb b/spec/controllers/groups/clusters_controller_spec.rb index 0f28499194e..d5a149a57df 100644 --- a/spec/controllers/groups/clusters_controller_spec.rb +++ b/spec/controllers/groups/clusters_controller_spec.rb @@ -429,12 +429,14 @@ describe Groups::ClustersController do end let(:cluster) { create(:cluster, :provided_by_user, cluster_type: :group_type, groups: [group]) } + let(:domain) { 'test-domain.com' } let(:params) do { cluster: { enabled: false, - name: 'my-new-cluster-name' + name: 'my-new-cluster-name', + domain: domain } } end @@ -447,6 +449,20 @@ describe Groups::ClustersController do expect(flash[:notice]).to eq('Kubernetes cluster was successfully updated.') expect(cluster.enabled).to be_falsey expect(cluster.name).to eq('my-new-cluster-name') + expect(cluster.domain).to eq('test-domain.com') + end + + context 'when domain is invalid' do + let(:domain) { 'not-a-valid-domain' } + + it 'should not update cluster attributes' do + go + + cluster.reload + expect(response).to render_template(:show) + expect(cluster.name).not_to eq('my-new-cluster-name') + expect(cluster.domain).not_to eq('test-domain.com') + end end context 'when format is json' do @@ -456,7 +472,8 @@ describe Groups::ClustersController do { cluster: { enabled: false, - name: 'my-new-cluster-name' + name: 'my-new-cluster-name', + domain: domain } } end |