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

Update condition to be more explicit on EE

parent 7819a2e8
...@@ -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') && License.feature_available?(:custom_file_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
......
...@@ -4,27 +4,25 @@ require 'spec_helper' ...@@ -4,27 +4,25 @@ require 'spec_helper'
describe 'layouts/nav/sidebar/_admin' do describe 'layouts/nav/sidebar/_admin' do
context 'on settings' do context 'on settings' do
context 'when templates partial is present' do before do
before do stub_licensed_features(custom_file_templates: custom_file_templates)
stub_licensed_features(custom_file_templates: custom_file_templates)
render render
end end
context 'license with custom_file_templates feature' do context 'license with custom_file_templates feature' do
let(:custom_file_templates) { true } let(:custom_file_templates) { true }
it 'includes Templates link' do it 'includes Templates link' do
expect(rendered).to have_link('Templates', href: '/admin/application_settings/templates') expect(rendered).to have_link('Templates', href: '/admin/application_settings/templates')
end
end end
end
context 'license without custom_file_templates feature' do context 'license without custom_file_templates feature' do
let(:custom_file_templates) { false } let(:custom_file_templates) { false }
it 'does not include Templates link' do it 'does not include Templates link' do
expect(rendered).not_to have_link('Templates', href: '/admin/application_settings/templates') expect(rendered).not_to have_link('Templates', href: '/admin/application_settings/templates')
end
end end
end end
end end
......
...@@ -93,18 +93,15 @@ describe 'layouts/nav/sidebar/_admin' do ...@@ -93,18 +93,15 @@ describe 'layouts/nav/sidebar/_admin' do
end end
context 'on settings' do context 'on settings' do
it 'includes General link' do before do
render render
end
it 'includes General link' do
expect(rendered).to have_link('General', href: general_admin_application_settings_path) expect(rendered).to have_link('General', href: general_admin_application_settings_path)
end end
context 'when templates partial is not present' do context 'when GitLab FOSS' 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
it 'does not include Templates link' do it 'does not include Templates link' do
expect(rendered).not_to have_link('Templates', href: '/admin/application_settings/templates') expect(rendered).not_to have_link('Templates', href: '/admin/application_settings/templates')
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