diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-09-23 16:26:15 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-09-23 16:28:51 -0400 |
commit | be142e6bd687d223dd4a543295d18676f408b7e3 (patch) | |
tree | 3b85972eadbe88aecff9237b73757ce78d5e9de8 | |
parent | 48cfad9013f1aa4745bf2b07bfd07e34724ba037 (diff) | |
download | gitlab-ce-be142e6bd687d223dd4a543295d18676f408b7e3.tar.gz |
Move the `version_check_enabled` check from view to helper
-rw-r--r-- | app/helpers/version_check_helper.rb | 2 | ||||
-rw-r--r-- | app/views/help/index.html.haml | 3 | ||||
-rw-r--r-- | spec/views/help/index.html.haml_spec.rb | 3 |
3 files changed, 3 insertions, 5 deletions
diff --git a/app/helpers/version_check_helper.rb b/app/helpers/version_check_helper.rb index f64d730b448..a674564c4ec 100644 --- a/app/helpers/version_check_helper.rb +++ b/app/helpers/version_check_helper.rb @@ -1,6 +1,6 @@ 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 diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index abffabfc41d..2333e6fdf1d 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -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 diff --git a/spec/views/help/index.html.haml_spec.rb b/spec/views/help/index.html.haml_spec.rb index 4fd561428f6..91cf4cb98c0 100644 --- a/spec/views/help/index.html.haml_spec.rb +++ b/spec/views/help/index.html.haml_spec.rb @@ -49,7 +49,6 @@ describe 'help/index' do 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 |