summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-13 13:26:31 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-13 13:26:31 +0000
commitb7dfe2ae4054aa40e15182fd3c6cb7dd39f131db (patch)
tree5ab080ca9cadeb6cd9578bf301e4e9e8810bed9e /spec/features
parent25cb337cf12438169f1b14bc5dace8a06a7356e3 (diff)
downloadgitlab-ce-b7dfe2ae4054aa40e15182fd3c6cb7dd39f131db.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/projects/jobs_spec.rb25
1 files changed, 24 insertions, 1 deletions
diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb
index d1783de0330..cebca338f33 100644
--- a/spec/features/projects/jobs_spec.rb
+++ b/spec/features/projects/jobs_spec.rb
@@ -534,9 +534,32 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
end
it 'shows deployment message' do
- expect(page).to have_content 'This job is the most recent deployment'
+ expect(page).to have_content 'This job is the most recent deployment to production'
expect(find('.js-environment-link')['href']).to match("environments/#{environment.id}")
end
+
+ context 'when there is a cluster used for the deployment' do
+ let(:cluster) { create(:cluster, name: 'the-cluster') }
+ let(:deployment) { create(:deployment, :success, cluster: cluster, environment: environment, project: environment.project) }
+ let(:user_access_level) { :maintainer }
+
+ it 'shows a link to the cluster' do
+ expect(page).to have_link 'the-cluster'
+ end
+
+ it 'shows the name of the cluster' do
+ expect(page).to have_content 'Cluster the-cluster was used'
+ end
+
+ context 'when the user is not able to view the cluster' do
+ let(:user_access_level) { :developer }
+
+ it 'includes only the name of the cluster without a link' do
+ expect(page).to have_content 'Cluster the-cluster was used'
+ expect(page).not_to have_link 'the-cluster'
+ end
+ end
+ end
end
context 'job is complete and not successful' do