Commit 08c9cb4c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Finally fix stuff related to dynamic config

parent 939c046a
module ApplicationSettingsHelper module ApplicationSettingsHelper
def gravatar_enabled?
current_application_settings.gravatar_enabled?
end
def signup_enabled? def signup_enabled?
current_application_settings.signup_enabled current_application_settings.signup_enabled?
end end
def signin_enabled? def signin_enabled?
current_application_settings.signin_enabled current_application_settings.signin_enabled?
end end
def extra_sign_in_text def extra_sign_in_text
......
...@@ -14,6 +14,6 @@ module ProfileHelper ...@@ -14,6 +14,6 @@ module ProfileHelper
end end
def show_profile_remove_tab? def show_profile_remove_tab?
gitlab_config.signup_enabled signup_enabled?
end end
end end
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
%p %p
Sign up Sign up
%span.light.pull-right %span.light.pull-right
= boolean_to_icon gitlab_config.signup_enabled = boolean_to_icon signup_enabled?
%p %p
LDAP LDAP
%span.light.pull-right %span.light.pull-right
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
%p %p
Gravatar Gravatar
%span.light.pull-right %span.light.pull-right
= boolean_to_icon Gitlab.config.gravatar.enabled = boolean_to_icon gravatar_enabled?
%p %p
OmniAuth OmniAuth
%span.light.pull-right %span.light.pull-right
......
...@@ -9,7 +9,7 @@ describe "Profile account page", feature: true do ...@@ -9,7 +9,7 @@ describe "Profile account page", feature: true do
describe "when signup is enabled" do describe "when signup is enabled" do
before do before do
Gitlab.config.gitlab.stub(:signup_enabled).and_return(true) ApplicationSetting.any_instance.stub(signup_enabled?: true)
visit profile_account_path visit profile_account_path
end end
...@@ -23,7 +23,7 @@ describe "Profile account page", feature: true do ...@@ -23,7 +23,7 @@ describe "Profile account page", feature: true do
describe "when signup is disabled" do describe "when signup is disabled" do
before do before do
Gitlab.config.gitlab.stub(:signup_enabled).and_return(false) ApplicationSetting.any_instance.stub(signup_enabled?: false)
visit profile_account_path visit profile_account_path
end end
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Users', feature: true do describe 'Users', feature: true do
describe "GET /users/sign_up" do describe "GET /users/sign_up" do
before do before do
Gitlab.config.gitlab.stub(:signup_enabled).and_return(true) ApplicationSetting.any_instance.stub(signup_enabled?: true)
end end
it "should create a new user account" do it "should create a new user account" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment