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
33e236c6
Commit
33e236c6
authored
Mar 26, 2013
by
Sato Hiroyuki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix RoutingError when changing username to non ascii char.
parent
90db28d6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+2
-0
features/admin/users.feature
features/admin/users.feature
+8
-0
features/steps/admin/admin_users.rb
features/steps/admin/admin_users.rb
+23
-0
No files found.
app/controllers/admin/users_controller.rb
View file @
33e236c6
...
@@ -84,6 +84,8 @@ class Admin::UsersController < Admin::ApplicationController
...
@@ -84,6 +84,8 @@ class Admin::UsersController < Admin::ApplicationController
format
.
html
{
redirect_to
[
:admin
,
admin_user
],
notice:
'User was successfully updated.'
}
format
.
html
{
redirect_to
[
:admin
,
admin_user
],
notice:
'User was successfully updated.'
}
format
.
json
{
head
:ok
}
format
.
json
{
head
:ok
}
else
else
# restore username to keep form action url.
admin_user
.
username
=
params
[
:id
]
format
.
html
{
render
action:
"edit"
}
format
.
html
{
render
action:
"edit"
}
format
.
json
{
render
json:
admin_user
.
errors
,
status: :unprocessable_entity
}
format
.
json
{
render
json:
admin_user
.
errors
,
status: :unprocessable_entity
}
end
end
...
...
features/admin/users.feature
View file @
33e236c6
...
@@ -6,3 +6,11 @@ Feature: Admin Users
...
@@ -6,3 +6,11 @@ Feature: Admin Users
Scenario
:
On Admin Users
Scenario
:
On Admin Users
Given
I visit admin users page
Given
I visit admin users page
Then
I should see all users
Then
I should see all users
Scenario
:
Edit user and change username to non ascii char
When
I visit admin users page
And
Click edit
And
Input non ascii char in username
And
Click save
Then
See username error message
And
Not chenged form action url
features/steps/admin/admin_users.rb
View file @
33e236c6
...
@@ -8,4 +8,27 @@ class AdminUsers < Spinach::FeatureSteps
...
@@ -8,4 +8,27 @@ class AdminUsers < Spinach::FeatureSteps
page
.
should
have_content
user
.
name
page
.
should
have_content
user
.
name
end
end
end
end
And
'Click edit'
do
@user
=
User
.
first
find
(
"#edit_user_
#{
@user
.
id
}
"
).
click
end
And
'Input non ascii char in username'
do
fill_in
'user_username'
,
with:
"
\u
3042
\u
3044"
end
And
'Click save'
do
click_button
(
"Save"
)
end
Then
'See username error message'
do
within
"#error_explanation"
do
page
.
should
have_content
"Username"
end
end
And
'Not chenged form action url'
do
page
.
should
have_selector
%(form[action="/admin/users/#{@user.username}"])
end
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