Commit e46b221a authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch...

Merge branch '210456-remove-admin-settings-templates-link-from-side-bar-having-an-invalid-license' into 'master'

Remove Admin > Settings > Templates from sidenav when insufficient license

See merge request gitlab-org/gitlab!27172
parents 83a67aaa 5a73f42b
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
= link_to repository_admin_application_settings_path, title: _('Repository'), class: 'qa-admin-settings-repository-item' do = link_to repository_admin_application_settings_path, title: _('Repository'), class: 'qa-admin-settings-repository-item' do
%span %span
= _('Repository') = _('Repository')
- if template_exists?('admin/application_settings/templates') - if Gitlab.ee? && License.feature_available?(:custom_file_templates)
= nav_link(path: 'application_settings#templates') do = nav_link(path: 'application_settings#templates') do
= link_to templates_admin_application_settings_path, title: _('Templates'), class: 'qa-admin-settings-template-item' do = link_to templates_admin_application_settings_path, title: _('Templates'), class: 'qa-admin-settings-template-item' do
%span %span
......
---
title: Remove Admin > Settings > Templates link from sidenav when insufficient license
merge_request: 27172
author:
type: fixed
# frozen_string_literal: true
require 'spec_helper'
describe 'layouts/nav/sidebar/_admin' do
context 'on settings' do
before do
stub_licensed_features(custom_file_templates: custom_file_templates)
render
end
context 'license with custom_file_templates feature' do
let(:custom_file_templates) { true }
it 'includes Templates link' do
expect(rendered).to have_link('Templates', href: '/admin/application_settings/templates')
end
end
context 'license without custom_file_templates feature' do
let(:custom_file_templates) { false }
it 'does not include Templates link' do
expect(rendered).not_to have_link('Templates', href: '/admin/application_settings/templates')
end
end
end
end
...@@ -91,4 +91,20 @@ describe 'layouts/nav/sidebar/_admin' do ...@@ -91,4 +91,20 @@ describe 'layouts/nav/sidebar/_admin' do
it_behaves_like 'page has active tab', 'Monitoring' it_behaves_like 'page has active tab', 'Monitoring'
it_behaves_like 'page has active sub tab', 'Background Jobs' it_behaves_like 'page has active sub tab', 'Background Jobs'
end end
context 'on settings' do
before do
render
end
it 'includes General link' do
expect(rendered).to have_link('General', href: general_admin_application_settings_path)
end
context 'when GitLab FOSS' do
it 'does not include Templates link' do
expect(rendered).not_to have_link('Templates', href: '/admin/application_settings/templates')
end
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