diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-19 22:11:55 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-19 22:11:55 +0000 |
commit | 5a8431feceba47fd8e1804d9aa1b1730606b71d5 (patch) | |
tree | e5df8e0ceee60f4af8093f5c4c2f934b8abced05 /spec/features/groups/clusters | |
parent | 4d477238500c347c6553d335d920bedfc5a46869 (diff) | |
download | gitlab-ce-5a8431feceba47fd8e1804d9aa1b1730606b71d5.tar.gz |
Add latest changes from gitlab-org/gitlab@12-5-stable-ee
Diffstat (limited to 'spec/features/groups/clusters')
-rw-r--r-- | spec/features/groups/clusters/eks_spec.rb | 35 | ||||
-rw-r--r-- | spec/features/groups/clusters/user_spec.rb | 8 |
2 files changed, 41 insertions, 2 deletions
diff --git a/spec/features/groups/clusters/eks_spec.rb b/spec/features/groups/clusters/eks_spec.rb new file mode 100644 index 00000000000..b6942304c22 --- /dev/null +++ b/spec/features/groups/clusters/eks_spec.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'Group AWS EKS Cluster', :js do + let(:group) { create(:group) } + let(:user) { create(:user) } + + before do + group.add_maintainer(user) + gitlab_sign_in(user) + + allow(Groups::ClustersController).to receive(:STATUS_POLLING_INTERVAL) { 100 } + allow_any_instance_of(Clusters::Kubernetes::CreateOrUpdateNamespaceService).to receive(:execute) + allow_any_instance_of(Clusters::Cluster).to receive(:retrieve_connection_status).and_return(:connected) + end + + context 'when user does not have a cluster and visits group clusters page' do + before do + visit group_clusters_path(group) + + click_link 'Add Kubernetes cluster' + end + + context 'when user creates a cluster on AWS EKS' do + before do + click_link 'Amazon EKS' + end + + it 'user sees a form to create an EKS cluster' do + expect(page).to have_content('Create new Cluster on EKS') + end + end + end +end diff --git a/spec/features/groups/clusters/user_spec.rb b/spec/features/groups/clusters/user_spec.rb index 8891866c1f8..e06f2efe183 100644 --- a/spec/features/groups/clusters/user_spec.rb +++ b/spec/features/groups/clusters/user_spec.rb @@ -13,8 +13,12 @@ describe 'User Cluster', :js do gitlab_sign_in(user) allow(Groups::ClustersController).to receive(:STATUS_POLLING_INTERVAL) { 100 } - allow_any_instance_of(Clusters::Kubernetes::CreateOrUpdateNamespaceService).to receive(:execute) - allow_any_instance_of(Clusters::Cluster).to receive(:retrieve_connection_status).and_return(:connected) + allow_next_instance_of(Clusters::Kubernetes::CreateOrUpdateNamespaceService) do |instance| + allow(instance).to receive(:execute) + end + allow_next_instance_of(Clusters::Cluster) do |instance| + allow(instance).to receive(:retrieve_connection_status).and_return(:connected) + end end context 'when user does not have a cluster and visits cluster index page' do |