summaryrefslogtreecommitdiff
path: root/spec/features/clusters
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-15 06:07:25 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-15 06:07:25 +0000
commit00050519d16f7c0296fa0113de7065a607862501 (patch)
tree9c7ef6b2be04e0c0167952beae22a5648e02ae93 /spec/features/clusters
parent94be244a9fb5da7a8b5d5fb99e5760cde17715ac (diff)
downloadgitlab-ce-00050519d16f7c0296fa0113de7065a607862501.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/clusters')
-rw-r--r--spec/features/clusters/cluster_detail_page_spec.rb28
1 files changed, 22 insertions, 6 deletions
diff --git a/spec/features/clusters/cluster_detail_page_spec.rb b/spec/features/clusters/cluster_detail_page_spec.rb
index 927862689c1..437e7f18c48 100644
--- a/spec/features/clusters/cluster_detail_page_spec.rb
+++ b/spec/features/clusters/cluster_detail_page_spec.rb
@@ -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