diff options
author | Thong Kuah <tkuah@gitlab.com> | 2018-11-06 21:55:10 +1300 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2018-11-08 23:28:30 +1300 |
commit | 5a042ef2fbe1bd57b9428c89b49d2fa1e248ad46 (patch) | |
tree | 15130ca3700f2da12044087510128a715758d6e0 /spec/controllers | |
parent | 530371840288af4bc54bc2c32c602e568ce20854 (diff) | |
download | gitlab-ce-5a042ef2fbe1bd57b9428c89b49d2fa1e248ad46.tar.gz |
Only project clusters has Project Namespace field
Group clusters should not allow Project Namespace so don't show that
field input too
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/groups/clusters_controller_spec.rb | 18 | ||||
-rw-r--r-- | spec/controllers/projects/clusters_controller_spec.rb | 4 |
2 files changed, 5 insertions, 17 deletions
diff --git a/spec/controllers/groups/clusters_controller_spec.rb b/spec/controllers/groups/clusters_controller_spec.rb index 92a7ee6d84b..6be1d300aa4 100644 --- a/spec/controllers/groups/clusters_controller_spec.rb +++ b/spec/controllers/groups/clusters_controller_spec.rb @@ -146,7 +146,7 @@ describe Groups::ClustersController do it 'has new object' do go - expect(assigns(:gcp_cluster)).to be_an_instance_of(Clusters::Cluster) + expect(assigns(:gcp_cluster)).to be_an_instance_of(Clusters::ClusterPresenter) end end @@ -167,7 +167,7 @@ describe Groups::ClustersController do it 'has new object' do go - expect(assigns(:user_cluster)).to be_an_instance_of(Clusters::Cluster) + expect(assigns(:user_cluster)).to be_an_instance_of(Clusters::ClusterPresenter) end end @@ -281,7 +281,6 @@ describe Groups::ClustersController do platform_kubernetes_attributes: { api_url: 'http://my-url', token: 'test', - namespace: 'aaa' } } } @@ -315,7 +314,6 @@ describe Groups::ClustersController do platform_kubernetes_attributes: { api_url: 'http://my-url', token: 'test', - namespace: 'aaa', authorization_type: 'rbac' } } @@ -433,9 +431,6 @@ describe Groups::ClustersController do cluster: { enabled: false, name: 'my-new-cluster-name', - platform_kubernetes_attributes: { - namespace: 'my-namespace' - } } } end @@ -448,7 +443,6 @@ 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.platform_kubernetes.namespace).to eq('my-namespace') end context 'when format is json' do @@ -459,9 +453,6 @@ describe Groups::ClustersController do cluster: { enabled: false, name: 'my-new-cluster-name', - platform_kubernetes_attributes: { - namespace: 'my-namespace' - } } } end @@ -473,7 +464,6 @@ describe Groups::ClustersController do expect(response).to have_http_status(:no_content) expect(cluster.enabled).to be_falsey expect(cluster.name).to eq('my-new-cluster-name') - expect(cluster.platform_kubernetes.namespace).to eq('my-namespace') end end @@ -482,9 +472,7 @@ describe Groups::ClustersController do { cluster: { enabled: false, - platform_kubernetes_attributes: { - namespace: 'my invalid namespace #@' - } + name: '' } } end diff --git a/spec/controllers/projects/clusters_controller_spec.rb b/spec/controllers/projects/clusters_controller_spec.rb index e7bb4035e55..483222363bb 100644 --- a/spec/controllers/projects/clusters_controller_spec.rb +++ b/spec/controllers/projects/clusters_controller_spec.rb @@ -122,7 +122,7 @@ describe Projects::ClustersController do it 'has new object' do go - expect(assigns(:gcp_cluster)).to be_an_instance_of(Clusters::Cluster) + expect(assigns(:gcp_cluster)).to be_an_instance_of(Clusters::ClusterPresenter) end end @@ -143,7 +143,7 @@ describe Projects::ClustersController do it 'has new object' do go - expect(assigns(:user_cluster)).to be_an_instance_of(Clusters::Cluster) + expect(assigns(:user_cluster)).to be_an_instance_of(Clusters::ClusterPresenter) end end |