diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb')
-rw-r--r-- | spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb b/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb index bf5b5785b8d..3fb9fb54b01 100644 --- a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb +++ b/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'layouts/nav/sidebar/_project' do - let(:project) { create(:project, :repository) } + let_it_be_with_reload(:project) { create(:project, :repository) } before do assign(:project, project) @@ -246,6 +246,30 @@ RSpec.describe 'layouts/nav/sidebar/_project' do end end + describe 'Tracing' do + it 'is not visible to unauthorized user' do + allow(view).to receive(:can?).and_return(false) + + render + + expect(rendered).not_to have_text 'Tracing' + end + + it 'links to Tracing page' do + render + + expect(rendered).to have_link('Tracing', href: project_tracing_path(project)) + end + + context 'without project.tracing_external_url' do + it 'links to Tracing page' do + render + + expect(rendered).to have_link('Tracing', href: project_tracing_path(project)) + end + end + end + describe 'Alert Management' do it 'shows the Alerts sidebar entry' do render @@ -299,10 +323,10 @@ RSpec.describe 'layouts/nav/sidebar/_project' do allow(Gitlab).to receive(:com?).and_return(true) end - it 'does not display "Access Tokens" nav item' do + it 'displays "Access Tokens" nav item' do render - expect(rendered).not_to have_link('Access Tokens', href: project_settings_access_tokens_path(project)) + expect(rendered).to have_link('Access Tokens', href: project_settings_access_tokens_path(project)) end end end |