Finally fix stuff related to dynamic config

This commit is contained in:
Dmitriy Zaporozhets 2015-01-08 14:26:43 -08:00
parent 939c046a98
commit 08c9cb4cab
5 changed files with 12 additions and 8 deletions

View file

@ -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

View file

@ -14,6 +14,6 @@ module ProfileHelper
end
def show_profile_remove_tab?
gitlab_config.signup_enabled
signup_enabled?
end
end

View file

@ -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

View file

@ -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

View file

@ -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