Commit ad1cd216 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'only-show-service-desk-email-to-members' into 'master'

Only show Service Desk email address to project members

See merge request gitlab-org/gitlab-ee!15676
parents 4240ceba 32d3bb3a
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
- else - else
%h5= title_text %h5= title_text
- if service_desk_enabled - if can_edit_project_settings && service_desk_enabled
%p %p
= _("Have your users email") = _("Have your users email")
%code= @project.service_desk_address %code= @project.service_desk_address
......
---
title: Only show Service Desk email address to project members
merge_request: 15676
author:
type: changed
...@@ -37,16 +37,12 @@ describe 'Service Desk Issue Tracker', :js do ...@@ -37,16 +37,12 @@ describe 'Service Desk Issue Tracker', :js do
visit service_desk_project_issues_path(project_without_service_desk) visit service_desk_project_issues_path(project_without_service_desk)
end end
it 'displays the large info box' do it 'displays the large info box, documentation, and a button to configure' do
expect(page).to have_css('.empty-state') aggregate_failures do
end expect(page).to have_css('.empty-state')
expect(page).to have_link('Read more', href: help_page_path('user/project/service_desk'))
it 'has a link to the documentation' do expect(page).to have_link('Turn on Service Desk')
expect(page).to have_link('Read more', href: help_page_path('user/project/service_desk')) end
end
it 'does show a button configure service desk' do
expect(page).to have_link('Turn on Service Desk')
end end
end end
...@@ -70,20 +66,32 @@ describe 'Service Desk Issue Tracker', :js do ...@@ -70,20 +66,32 @@ describe 'Service Desk Issue Tracker', :js do
visit service_desk_project_issues_path(project) visit service_desk_project_issues_path(project)
end end
it 'displays the large info box' do it 'displays the large info box, documentation, and the address' do
expect(page).to have_css('.empty-state') aggregate_failures do
expect(page).to have_css('.empty-state')
expect(page).to have_link('Read more', href: help_page_path('user/project/service_desk'))
expect(page).not_to have_link('Turn on Service Desk')
expect(page).to have_content(project.service_desk_address)
end
end end
it 'has a link to the documentation' do context 'when user does not have permission to edit project settings' do
expect(page).to have_link('Read more', href: help_page_path('user/project/service_desk')) before do
end user_2 = create(:user)
it 'does not show a button configure service desk' do project.add_guest(user_2)
expect(page).not_to have_link('Turn on Service Desk') sign_in(user_2)
end visit service_desk_project_issues_path(project)
end
it 'shows the service desk email address' do it 'displays the large info box and the documentation link' do
expect(page).to have_content(project.service_desk_address) aggregate_failures do
expect(page).to have_css('.empty-state')
expect(page).to have_link('Read more', href: help_page_path('user/project/service_desk'))
expect(page).not_to have_link('Turn on Service Desk')
expect(page).not_to have_content(project.service_desk_address)
end
end
end end
end end
end end
...@@ -99,20 +107,13 @@ describe 'Service Desk Issue Tracker', :js do ...@@ -99,20 +107,13 @@ describe 'Service Desk Issue Tracker', :js do
visit service_desk_project_issues_path(project) visit service_desk_project_issues_path(project)
end end
it 'displays the small info box' do it 'displays the small info box, documentation, a button to configure service desk, and the address' do
expect(page).to have_css('.non-empty-state') aggregate_failures do
end expect(page).to have_css('.non-empty-state')
expect(page).to have_link('Read more', href: help_page_path('user/project/service_desk'))
it 'has a link to the documentation' do expect(page).not_to have_link('Turn on Service Desk')
expect(page).to have_link('Read more', href: help_page_path('user/project/service_desk')) expect(page).to have_content(project.service_desk_address)
end end
it 'does not show a button configure service desk' do
expect(page).not_to have_link('Turn on Service Desk')
end
it 'shows the service desk email address' do
expect(page).to have_content(project.service_desk_address)
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