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