Commit b6cb00fa authored by James Fargher's avatar James Fargher

Added instance cluster detail page integration specs

parent 564942ea
......@@ -46,4 +46,16 @@ describe 'Clusterable > Show page' do
expect(page).to have_selector('.js-cluster-nav-environments', text: 'Environments')
end
end
context 'when clusterable is an instance' do
let(:current_user) { create(:admin) }
let(:cluster_path) { admin_cluster_path(cluster) }
let(:cluster) { create(:cluster, :provided_by_gcp, :instance) }
it 'shows the environments tab' do
visit cluster_path
expect(page).to have_selector('.js-cluster-nav-environments', text: 'Environments')
end
end
end
......@@ -14,10 +14,6 @@ describe 'Clusterable > Show page' do
end
shared_examples 'show page' do
before do
clusterable.add_maintainer(current_user)
end
it 'allow the user to set domain' do
visit cluster_path
......@@ -63,7 +59,6 @@ describe 'Clusterable > Show page' do
shared_examples 'editing a GCP cluster' do
before do
clusterable.add_maintainer(current_user)
visit cluster_path
end
......@@ -92,7 +87,6 @@ describe 'Clusterable > Show page' do
shared_examples 'editing a user-provided cluster' do
before do
stub_kubeclient_discover(cluster.platform.api_url)
clusterable.add_maintainer(current_user)
visit cluster_path
end
......@@ -123,6 +117,10 @@ describe 'Clusterable > Show page' do
let(:cluster_path) { project_cluster_path(clusterable, cluster) }
let(:cluster) { create(:cluster, :provided_by_gcp, :project, projects: [clusterable]) }
before do
clusterable.add_maintainer(current_user)
end
it_behaves_like 'show page'
it_behaves_like 'editing a GCP cluster'
......@@ -137,6 +135,10 @@ describe 'Clusterable > Show page' do
let(:cluster_path) { group_cluster_path(clusterable, cluster) }
let(:cluster) { create(:cluster, :provided_by_gcp, :group, groups: [clusterable]) }
before do
clusterable.add_maintainer(current_user)
end
it_behaves_like 'show page'
it_behaves_like 'editing a GCP cluster'
......@@ -145,4 +147,18 @@ describe 'Clusterable > Show page' do
let(:cluster) { create(:cluster, :provided_by_user, :group, groups: [clusterable]) }
end
end
context 'when clusterable is an instance' do
let(:current_user) { create(:admin) }
let(:cluster_path) { admin_cluster_path(cluster) }
let(:cluster) { create(:cluster, :provided_by_gcp, :instance) }
it_behaves_like 'show page'
it_behaves_like 'editing a GCP cluster'
it_behaves_like 'editing a user-provided cluster' do
let(:cluster) { create(:cluster, :provided_by_user, :instance) }
end
end
end
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