Commit 5a73f42b authored by Justin Ho's avatar Justin Ho

Update condition to be more explicit on EE

parent 7819a2e8
......@@ -245,7 +245,7 @@
= link_to repository_admin_application_settings_path, title: _('Repository'), class: 'qa-admin-settings-repository-item' do
%span
= _('Repository')
- if template_exists?('admin/application_settings/templates') && License.feature_available?(:custom_file_templates)
- if Gitlab.ee? && License.feature_available?(:custom_file_templates)
= nav_link(path: 'application_settings#templates') do
= link_to templates_admin_application_settings_path, title: _('Templates'), class: 'qa-admin-settings-template-item' do
%span
......
......@@ -4,27 +4,25 @@ require 'spec_helper'
describe 'layouts/nav/sidebar/_admin' do
context 'on settings' do
context 'when templates partial is present' do
before do
stub_licensed_features(custom_file_templates: custom_file_templates)
before do
stub_licensed_features(custom_file_templates: custom_file_templates)
render
end
render
end
context 'license with custom_file_templates feature' do
let(:custom_file_templates) { true }
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
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 }
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
it 'does not include Templates link' do
expect(rendered).not_to have_link('Templates', href: '/admin/application_settings/templates')
end
end
end
......
......@@ -93,18 +93,15 @@ describe 'layouts/nav/sidebar/_admin' do
end
context 'on settings' do
it 'includes General link' 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 templates partial is not present' do
before do
allow(view).to receive(:template_exists?).and_call_original
allow(view).to receive(:template_exists?).with('admin/application_settings/templates') { false }
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
......
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