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
if @cluster.persisted?
redirect_to project_cluster_path(project, @cluster)
else
render :new
render :new_gcp
end
end
......
......@@ -6,5 +6,5 @@
= render 'sidebar'
.col-sm-8
= render 'header'
= render 'form'
......@@ -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
......
......@@ -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
......
......@@ -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
......
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