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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
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
Show 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
...
@@ -26,7 +26,7 @@ class RegistrationsController < Devise::RegistrationsController
private
private
def
signup_enabled?
def
signup_enabled?
if
current_application_settings
.
signup_enabled?
unless
current_application_settings
.
signup_enabled?
redirect_to
(
new_user_session_path
)
redirect_to
(
new_user_session_path
)
end
end
end
end
...
...
spec/helpers/application_helper_spec.rb
View file @
939c046a
...
@@ -87,7 +87,7 @@ describe ApplicationHelper do
...
@@ -87,7 +87,7 @@ describe ApplicationHelper do
let
(
:user_email
)
{
'user@email.com'
}
let
(
:user_email
)
{
'user@email.com'
}
it
"should return a generic avatar path when Gravatar is disabled"
do
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'
)
gravatar_icon
(
user_email
).
should
match
(
'no_avatar.png'
)
end
end
...
...
spec/models/application_setting_spec.rb
View file @
939c046a
require
'spec_helper'
require
'spec_helper'
describe
ApplicationSetting
,
models:
true
do
describe
ApplicationSetting
,
models:
true
do
describe
'should exists on start'
do
it
{
ApplicationSetting
.
create_from_defaults
.
should
be_valid
}
it
{
ApplicationSetting
.
count
.
should_not
be_zero
}
end
end
end
spec/requests/api/users_spec.rb
View file @
939c046a
...
@@ -186,7 +186,7 @@ describe API::API, api: true do
...
@@ -186,7 +186,7 @@ describe API::API, api: true do
describe
"GET /users/sign_up"
do
describe
"GET /users/sign_up"
do
context
'enabled'
do
context
'enabled'
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 return sign up page if signup is enabled"
do
it
"should return sign up page if signup is enabled"
do
...
@@ -197,7 +197,7 @@ describe API::API, api: true do
...
@@ -197,7 +197,7 @@ describe API::API, api: true do
context
'disabled'
do
context
'disabled'
do
before
do
before
do
Gitlab
.
config
.
gitlab
.
stub
(
:signup_enabled
).
and_return
(
false
)
ApplicationSetting
.
any_instance
.
stub
(
signup_enabled?:
false
)
end
end
it
"should redirect to sign in page if signup is disabled"
do
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