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
Kazuhiko Shiozaki
gitlab-ce
Commits
ab22caa9
Commit
ab22caa9
authored
Feb 05, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redirect signup page to signin page.
Resolves #1916.
parent
56a456b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
29 deletions
+12
-29
app/controllers/registrations_controller.rb
app/controllers/registrations_controller.rb
+4
-0
spec/features/users_spec.rb
spec/features/users_spec.rb
+4
-9
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+4
-20
No files found.
app/controllers/registrations_controller.rb
View file @
ab22caa9
class
RegistrationsController
<
Devise
::
RegistrationsController
before_filter
:signup_enabled?
def
new
redirect_to
(
new_user_session_path
)
end
def
destroy
current_user
.
destroy
...
...
spec/features/users_spec.rb
View file @
ab22caa9
require
'spec_helper'
describe
'Users'
,
feature:
true
do
describe
"GET /users/sign_up"
do
before
do
ApplicationSetting
.
any_instance
.
stub
(
signup_enabled?:
true
)
end
describe
"GET /users/sign_in"
do
it
"should create a new user account"
do
visit
new_user_
registrat
ion_path
visit
new_user_
sess
ion_path
fill_in
"user_name"
,
with:
"Name Surname"
fill_in
"user_username"
,
with:
"Great"
fill_in
"user_email"
,
with:
"name@mail.com"
fill_in
"user_password"
,
with:
"password1234"
fill_in
"user_password_confirmation"
,
with:
"password1234"
expect
{
click_button
"Sign up"
}.
to
change
{
User
.
count
}.
by
(
1
)
fill_in
"user_password_sign_up"
,
with:
"password1234"
expect
{
click_button
"Sign up"
}.
to
change
{
User
.
count
}.
by
(
1
)
end
end
end
spec/requests/api/users_spec.rb
View file @
ab22caa9
...
...
@@ -184,27 +184,11 @@ describe API::API, api: true do
end
describe
"GET /users/sign_up"
do
context
'enabled'
do
before
do
ApplicationSetting
.
any_instance
.
stub
(
signup_enabled?:
true
)
end
it
"should return sign up page if signup is enabled"
do
get
"/users/sign_up"
response
.
status
.
should
==
200
end
end
context
'disabled'
do
before
do
ApplicationSetting
.
any_instance
.
stub
(
signup_enabled?:
false
)
end
it
"should redirect to sign in page if signup is disabled"
do
get
"/users/sign_up"
response
.
status
.
should
==
302
response
.
should
redirect_to
(
new_user_session_path
)
end
it
"should redirect to sign in page"
do
get
"/users/sign_up"
response
.
status
.
should
==
302
response
.
should
redirect_to
(
new_user_session_path
)
end
end
...
...
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