Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5a73f42b
Commit
5a73f42b
authored
Mar 18, 2020
by
Justin Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update condition to be more explicit on EE
parent
7819a2e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
23 deletions
+18
-23
app/views/layouts/nav/sidebar/_admin.html.haml
app/views/layouts/nav/sidebar/_admin.html.haml
+1
-1
ee/spec/views/layouts/nav/sidebar/_admin.html.haml_spec.rb
ee/spec/views/layouts/nav/sidebar/_admin.html.haml_spec.rb
+13
-15
spec/views/layouts/nav/sidebar/_admin.html.haml_spec.rb
spec/views/layouts/nav/sidebar/_admin.html.haml_spec.rb
+4
-7
No files found.
app/views/layouts/nav/sidebar/_admin.html.haml
View file @
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'
)
&&
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
...
...
ee/spec/views/layouts/nav/sidebar/_admin.html.haml_spec.rb
View file @
5a73f42b
...
@@ -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
...
...
spec/views/layouts/nav/sidebar/_admin.html.haml_spec.rb
View file @
5a73f42b
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment