Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
0c6bfeaf68bb
Commit
be142e6b
authored
Sep 23, 2015
by
Robert Speicher
Browse files
Move the `version_check_enabled` check from view to helper
parent
b40dfc0e7423
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/helpers/version_check_helper.rb
View file @
0c6bfeaf
module
VersionCheckHelper
def
version_status_badge
if
Rails
.
env
.
production?
if
Rails
.
env
.
production?
&&
current_application_settings
.
version_check_enabled
image_tag
VersionCheck
.
new
.
url
end
end
...
...
app/views/help/index.html.haml
View file @
0c6bfeaf
...
...
@@ -5,8 +5,7 @@
-
if
current_user
&&
current_user
.
admin?
%span
=
Gitlab
::
VERSION
%small
=
Gitlab
::
REVISION
-
if
current_application_settings
.
version_check_enabled
=
version_status_badge
=
version_status_badge
%p
.slead
GitLab is open source software to collaborate on code.
%br
...
...
spec/views/help/index.html.haml_spec.rb
View file @
0c6bfeaf
...
...
@@ -49,7 +49,6 @@ def stub_version(version, revision)
def
stub_helpers
allow
(
view
).
to
receive
(
:markdown
).
and_return
(
''
)
allow
(
view
).
to
receive
(
:current_application_settings
).
and_return
(
double
.
as_null_object
)
allow
(
view
).
to
receive
(
:version_status_badge
).
and_return
(
''
)
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