summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-11-01 23:13:22 +0900
committerShinya Maeda <shinya@gitlab.com>2017-11-01 23:13:22 +0900
commit5efea3a298258e91bdc8b768be512f317e05ed5e (patch)
treeec9670fac33f5ce016cdaecf24c53355715e110e
parent882cf2e409ce2ea798fce7f3082083fcdf143baf (diff)
downloadgitlab-ce-5efea3a298258e91bdc8b768be512f317e05ed5e.tar.gz
Fix pipeline. Fix routing when validation failed.
-rw-r--r--app/controllers/projects/clusters_controller.rb2
-rw-r--r--app/views/projects/clusters/new_gcp.html.haml2
-rw-r--r--config/routes/project.rb2
-rw-r--r--spec/controllers/projects/clusters_controller_spec.rb6
-rw-r--r--spec/features/projects/clusters_spec.rb6
5 files changed, 11 insertions, 7 deletions
diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb
index 23613b98e8c..0fd5635523f 100644
--- a/app/controllers/projects/clusters_controller.rb
+++ b/app/controllers/projects/clusters_controller.rb
@@ -41,7 +41,7 @@ class Projects::ClustersController < Projects::ApplicationController
if @cluster.persisted?
redirect_to project_cluster_path(project, @cluster)
else
- render :new
+ render :new_gcp
end
end
diff --git a/app/views/projects/clusters/new_gcp.html.haml b/app/views/projects/clusters/new_gcp.html.haml
index ad4b250db35..48e6b6ae8e8 100644
--- a/app/views/projects/clusters/new_gcp.html.haml
+++ b/app/views/projects/clusters/new_gcp.html.haml
@@ -6,5 +6,5 @@
= render 'sidebar'
.col-sm-8
= render 'header'
-
+
= render 'form'
diff --git a/config/routes/project.rb b/config/routes/project.rb
index 764f794f369..4b703ecb193 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -186,7 +186,7 @@ constraints(ProjectUrlConstrainer.new) do
resources :clusters, except: [:edit] do
collection do
get :login
- get '/providers/gcp/new', to: :new_gcp
+ get '/providers/gcp/new', action: :new_gcp
end
member do
diff --git a/spec/controllers/projects/clusters_controller_spec.rb b/spec/controllers/projects/clusters_controller_spec.rb
index bd924a1c7be..ec948e49ad0 100644
--- a/spec/controllers/projects/clusters_controller_spec.rb
+++ b/spec/controllers/projects/clusters_controller_spec.rb
@@ -73,11 +73,11 @@ describe Projects::ClustersController do
end
end
- describe 'GET new' do
+ describe 'GET new_gcp' do
render_views
subject do
- get :new, namespace_id: project.namespace,
+ get :new_gcp, namespace_id: project.namespace,
project_id: project
end
@@ -150,7 +150,7 @@ describe Projects::ClustersController do
it 'shows an error message' do
expect { subject }.not_to change { Gcp::Cluster.count }
- expect(response).to render_template(:new)
+ expect(response).to render_template(:new_gcp)
end
end
end
diff --git a/spec/features/projects/clusters_spec.rb b/spec/features/projects/clusters_spec.rb
index 810f2c39b43..b3f723b8104 100644
--- a/spec/features/projects/clusters_spec.rb
+++ b/spec/features/projects/clusters_spec.rb
@@ -18,6 +18,8 @@ feature 'Clusters', :js do
context 'when user does not have a cluster and visits cluster index page' do
before do
visit project_clusters_path(project)
+
+ click_link 'Create on GKE'
end
it 'user sees a new page' do
@@ -93,7 +95,7 @@ feature 'Clusters', :js do
it 'user sees creation form with the succeccful message' do
expect(page).to have_content('Cluster integration was successfully removed.')
- expect(page).to have_button('Create cluster')
+ expect(page).to have_content('Choose how to set up cluster integration')
end
end
end
@@ -102,6 +104,8 @@ feature 'Clusters', :js do
context 'when user has not signed in Google' do
before do
visit project_clusters_path(project)
+
+ click_link 'Create on GKE'
end
it 'user sees a login page' do