Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
939c046a
Commit
939c046a
authored
Jan 08, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix feature and tests
parent
d0a50985
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
7 deletions
+5
-7
app/controllers/registrations_controller.rb
app/controllers/registrations_controller.rb
+1
-1
spec/helpers/application_helper_spec.rb
spec/helpers/application_helper_spec.rb
+1
-1
spec/models/application_setting_spec.rb
spec/models/application_setting_spec.rb
+1
-3
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+2
-2
No files found.
app/controllers/registrations_controller.rb
View file @
939c046a
...
...
@@ -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
...
...
spec/helpers/application_helper_spec.rb
View file @
939c046a
...
...
@@ -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
...
...
spec/models/application_setting_spec.rb
View file @
939c046a
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
spec/requests/api/users_spec.rb
View file @
939c046a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment