Commit 5efea3a2 authored by Shinya Maeda's avatar Shinya Maeda

Fix pipeline. Fix routing when validation failed.

parent 882cf2e4
...@@ -41,7 +41,7 @@ class Projects::ClustersController < Projects::ApplicationController ...@@ -41,7 +41,7 @@ class Projects::ClustersController < Projects::ApplicationController
if @cluster.persisted? if @cluster.persisted?
redirect_to project_cluster_path(project, @cluster) redirect_to project_cluster_path(project, @cluster)
else else
render :new render :new_gcp
end end
end end
......
...@@ -6,5 +6,5 @@ ...@@ -6,5 +6,5 @@
= render 'sidebar' = render 'sidebar'
.col-sm-8 .col-sm-8
= render 'header' = render 'header'
= render 'form' = render 'form'
...@@ -186,7 +186,7 @@ constraints(ProjectUrlConstrainer.new) do ...@@ -186,7 +186,7 @@ constraints(ProjectUrlConstrainer.new) do
resources :clusters, except: [:edit] do resources :clusters, except: [:edit] do
collection do collection do
get :login get :login
get '/providers/gcp/new', to: :new_gcp get '/providers/gcp/new', action: :new_gcp
end end
member do member do
......
...@@ -73,11 +73,11 @@ describe Projects::ClustersController do ...@@ -73,11 +73,11 @@ describe Projects::ClustersController do
end end
end end
describe 'GET new' do describe 'GET new_gcp' do
render_views render_views
subject do subject do
get :new, namespace_id: project.namespace, get :new_gcp, namespace_id: project.namespace,
project_id: project project_id: project
end end
...@@ -150,7 +150,7 @@ describe Projects::ClustersController do ...@@ -150,7 +150,7 @@ describe Projects::ClustersController do
it 'shows an error message' do it 'shows an error message' do
expect { subject }.not_to change { Gcp::Cluster.count } expect { subject }.not_to change { Gcp::Cluster.count }
expect(response).to render_template(:new) expect(response).to render_template(:new_gcp)
end end
end end
end end
......
...@@ -18,6 +18,8 @@ feature 'Clusters', :js do ...@@ -18,6 +18,8 @@ feature 'Clusters', :js do
context 'when user does not have a cluster and visits cluster index page' do context 'when user does not have a cluster and visits cluster index page' do
before do before do
visit project_clusters_path(project) visit project_clusters_path(project)
click_link 'Create on GKE'
end end
it 'user sees a new page' do it 'user sees a new page' do
...@@ -93,7 +95,7 @@ feature 'Clusters', :js do ...@@ -93,7 +95,7 @@ feature 'Clusters', :js do
it 'user sees creation form with the succeccful message' 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_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 end
end end
...@@ -102,6 +104,8 @@ feature 'Clusters', :js do ...@@ -102,6 +104,8 @@ feature 'Clusters', :js do
context 'when user has not signed in Google' do context 'when user has not signed in Google' do
before do before do
visit project_clusters_path(project) visit project_clusters_path(project)
click_link 'Create on GKE'
end end
it 'user sees a login page' do it 'user sees a login page' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment