diff options
-rw-r--r-- | app/views/projects/environments/index.html.haml | 5 | ||||
-rw-r--r-- | spec/features/environments_spec.rb | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml index 89b0e1b39e0..a03f117291f 100644 --- a/app/views/projects/environments/index.html.haml +++ b/app/views/projects/environments/index.html.haml @@ -18,8 +18,9 @@ %br = succeed "." do = link_to "Read more about environments", help_page_path("ci", "environments") - = link_to new_namespace_project_environment_path(@project.namespace, @project), class: 'btn btn-create' do - New environment + - if can?(current_user, :create_environment, @project) + = link_to new_namespace_project_environment_path(@project.namespace, @project), class: 'btn btn-create' do + New environment - else .table-holder %table.table.environments diff --git a/spec/features/environments_spec.rb b/spec/features/environments_spec.rb index f9e066ade54..7fb28f4174b 100644 --- a/spec/features/environments_spec.rb +++ b/spec/features/environments_spec.rb @@ -33,7 +33,7 @@ feature 'Environments', feature: true do context 'without deployments' do scenario 'does show no deployments' do - expect(page).to have_content('You don\'t have any deployments right now.') + expect(page).to have_content('No deployments yet') end end @@ -108,7 +108,7 @@ feature 'Environments', feature: true do end scenario 'does create a new pipeline' do - expect(page).to have_content('production') + expect(page).to have_content('Production') end end |