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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
4688e137
Commit
4688e137
authored
Aug 09, 2018
by
🙈 jacopo beschi 🙉
Committed by
Sean McGivern
Aug 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "catch entering username as an email instead of returning a 500 error"
parent
de30e044
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
ee/app/views/admin/users/_limits.html.haml
ee/app/views/admin/users/_limits.html.haml
+2
-0
ee/changelogs/unreleased/7044-fix-admin-user-create-error.yml
...hangelogs/unreleased/7044-fix-admin-user-create-error.yml
+5
-0
spec/features/admin/admin_users_spec.rb
spec/features/admin/admin_users_spec.rb
+14
-1
No files found.
ee/app/views/admin/users/_limits.html.haml
View file @
4688e137
-
return
unless
@user
.
persisted?
=
f
.
fields_for
:namespace
do
|
namespace_form
|
=
f
.
fields_for
:namespace
do
|
namespace_form
|
=
namespace_form
.
hidden_field
:id
=
namespace_form
.
hidden_field
:id
%fieldset
%fieldset
...
...
ee/changelogs/unreleased/7044-fix-admin-user-create-error.yml
0 → 100644
View file @
4688e137
---
title
:
Fixes 500 error on user creation from admin panel with spaced username
merge_request
:
6804
author
:
Jacopo Beschi @jacopo-beschi
type
:
fixed
spec/features/admin/admin_users_spec.rb
View file @
4688e137
...
@@ -68,10 +68,12 @@ describe "Admin::Users" do
...
@@ -68,10 +68,12 @@ describe "Admin::Users" do
end
end
describe
"GET /admin/users/new"
do
describe
"GET /admin/users/new"
do
let
(
:user_username
)
{
'bang'
}
before
do
before
do
visit
new_admin_user_path
visit
new_admin_user_path
fill_in
"user_name"
,
with:
"Big Bang"
fill_in
"user_name"
,
with:
"Big Bang"
fill_in
"user_username"
,
with:
"bang"
fill_in
"user_username"
,
with:
user_username
fill_in
"user_email"
,
with:
"bigbang@mail.com"
fill_in
"user_email"
,
with:
"bigbang@mail.com"
end
end
...
@@ -112,6 +114,17 @@ describe "Admin::Users" do
...
@@ -112,6 +114,17 @@ describe "Admin::Users" do
expect
(
email
.
text_part
.
body
).
to
have_content
(
user
.
email
)
expect
(
email
.
text_part
.
body
).
to
have_content
(
user
.
email
)
expect
(
email
.
text_part
.
body
).
to
have_content
(
'password'
)
expect
(
email
.
text_part
.
body
).
to
have_content
(
'password'
)
end
end
context
'username contains spaces'
do
let
(
:user_username
)
{
'Bing bang'
}
it
"doesn't create the user and shows an error message"
do
expect
{
click_button
"Create user"
}.
to
change
{
User
.
count
}.
by
(
0
)
expect
(
page
).
to
have_content
(
'The form contains the following error'
)
expect
(
page
).
to
have_content
(
'Username can contain only letters, digits'
)
end
end
end
end
describe
"GET /admin/users/:id"
do
describe
"GET /admin/users/:id"
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