diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-05 00:09:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-05 00:09:06 +0300 |
commit | f4726e9f5029931fc74aee9d5eff93d6a762dcff (patch) | |
tree | bc6d47ea3d39afdf46c5df3d8328f3f266c38ae5 /spec/views/layouts | |
parent | 7c221ba5ce130ca50b892e6dd32783e1327718df (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views/layouts')
-rw-r--r-- | spec/views/layouts/nav/sidebar/_project_security_link.html.haml_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/views/layouts/nav/sidebar/_project_security_link.html.haml_spec.rb b/spec/views/layouts/nav/sidebar/_project_security_link.html.haml_spec.rb new file mode 100644 index 00000000000..d3fb35bff6d --- /dev/null +++ b/spec/views/layouts/nav/sidebar/_project_security_link.html.haml_spec.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'layouts/nav/sidebar/_project_security_link' do + let_it_be_with_reload(:project) { create(:project) } + context 'on security configuration' do + before do + assign(:project, project) + allow(controller).to receive(:controller_name).and_return('configuration') + allow(controller).to receive(:controller_path).and_return('projects/security/configuration') + allow(controller).to receive(:action_name).and_return('show') + allow(view).to receive(:any_project_nav_tab?).and_return(true) + allow(view).to receive(:project_nav_tab?).and_return(true) + end + + it 'activates Security & Compliance tab' do + render + + expect(rendered).to have_css('li.active', text: 'Security & Compliance') + end + + it 'activates Configuration sub tab' do + render + + expect(rendered).to have_css('.sidebar-sub-level-items > li.active', text: 'Configuration') + end + end +end |