diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-08 14:26:43 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-08 14:26:43 -0800 |
commit | 08c9cb4cabab648d90e6fcf055f1143fbbc994e8 (patch) | |
tree | cf02a2ba1eb4fe1c011ef2c2b37e884c13efa900 | |
parent | 939c046a9872c1d7c38d73dc08860681ecebd1f1 (diff) | |
download | gitlab-ce-08c9cb4cabab648d90e6fcf055f1143fbbc994e8.tar.gz |
Finally fix stuff related to dynamic config
-rw-r--r-- | app/helpers/application_settings_helper.rb | 8 | ||||
-rw-r--r-- | app/helpers/profile_helper.rb | 2 | ||||
-rw-r--r-- | app/views/admin/dashboard/index.html.haml | 4 | ||||
-rw-r--r-- | spec/features/profile_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/users_spec.rb | 2 |
5 files changed, 12 insertions, 8 deletions
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 16db33efd33..04299316102 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -1,10 +1,14 @@ module ApplicationSettingsHelper + def gravatar_enabled? + current_application_settings.gravatar_enabled? + end + def signup_enabled? - current_application_settings.signup_enabled + current_application_settings.signup_enabled? end def signin_enabled? - current_application_settings.signin_enabled + current_application_settings.signin_enabled? end def extra_sign_in_text diff --git a/app/helpers/profile_helper.rb b/app/helpers/profile_helper.rb index 6480fd3886f..9e37e44732a 100644 --- a/app/helpers/profile_helper.rb +++ b/app/helpers/profile_helper.rb @@ -14,6 +14,6 @@ module ProfileHelper end def show_profile_remove_tab? - gitlab_config.signup_enabled + signup_enabled? end end diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 7427cea7e8b..c6badeb4bd9 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -104,7 +104,7 @@ %p Sign up %span.light.pull-right - = boolean_to_icon gitlab_config.signup_enabled + = boolean_to_icon signup_enabled? %p LDAP %span.light.pull-right @@ -112,7 +112,7 @@ %p Gravatar %span.light.pull-right - = boolean_to_icon Gitlab.config.gravatar.enabled + = boolean_to_icon gravatar_enabled? %p OmniAuth %span.light.pull-right diff --git a/spec/features/profile_spec.rb b/spec/features/profile_spec.rb index bdf7b59114b..4a76e89fd34 100644 --- a/spec/features/profile_spec.rb +++ b/spec/features/profile_spec.rb @@ -9,7 +9,7 @@ describe "Profile account page", feature: true do describe "when signup is enabled" do before do - Gitlab.config.gitlab.stub(:signup_enabled).and_return(true) + ApplicationSetting.any_instance.stub(signup_enabled?: true) visit profile_account_path end @@ -23,7 +23,7 @@ describe "Profile account page", feature: true do describe "when signup is disabled" do before do - Gitlab.config.gitlab.stub(:signup_enabled).and_return(false) + ApplicationSetting.any_instance.stub(signup_enabled?: false) visit profile_account_path end diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb index a1206989d39..e2b631001c9 100644 --- a/spec/features/users_spec.rb +++ b/spec/features/users_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'Users', feature: true do describe "GET /users/sign_up" do before do - Gitlab.config.gitlab.stub(:signup_enabled).and_return(true) + ApplicationSetting.any_instance.stub(signup_enabled?: true) end it "should create a new user account" do |