Commit 939c046a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix feature and tests

parent d0a50985
......@@ -26,7 +26,7 @@ class RegistrationsController < Devise::RegistrationsController
private
def signup_enabled?
if current_application_settings.signup_enabled?
unless current_application_settings.signup_enabled?
redirect_to(new_user_session_path)
end
end
......
......@@ -87,7 +87,7 @@ describe ApplicationHelper do
let(:user_email) { 'user@email.com' }
it "should return a generic avatar path when Gravatar is disabled" do
Gitlab.config.gravatar.stub(:enabled).and_return(false)
ApplicationSetting.any_instance.stub(gravatar_enabled?: false)
gravatar_icon(user_email).should match('no_avatar.png')
end
......
require 'spec_helper'
describe ApplicationSetting, models: true do
describe 'should exists on start' do
it { ApplicationSetting.count.should_not be_zero }
end
it { ApplicationSetting.create_from_defaults.should be_valid }
end
......@@ -186,7 +186,7 @@ describe API::API, api: true do
describe "GET /users/sign_up" do
context 'enabled' do
before do
Gitlab.config.gitlab.stub(:signup_enabled).and_return(true)
ApplicationSetting.any_instance.stub(signup_enabled?: true)
end
it "should return sign up page if signup is enabled" do
......@@ -197,7 +197,7 @@ describe API::API, api: true do
context 'disabled' do
before do
Gitlab.config.gitlab.stub(:signup_enabled).and_return(false)
ApplicationSetting.any_instance.stub(signup_enabled?: false)
end
it "should redirect to sign in page if signup is disabled" 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