BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
44013827
Unverified
Commit
44013827
authored
Feb 25, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 500 error when try to update own profile in admin area
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
504777ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
users_controller.rb
app/controllers/admin/users_controller.rb
+3
-1
users.feature
features/admin/users.feature
+6
-0
admin_users.rb
features/steps/admin/admin_users.rb
+13
-0
No files found.
app/controllers/admin/users_controller.rb
View file @
44013827
...
...
@@ -68,7 +68,9 @@ class Admin::UsersController < Admin::ApplicationController
params
[
:user
].
delete
(
:password_confirmation
)
end
user
.
admin
=
(
admin
&&
admin
.
to_i
>
0
)
if
admin
.
present?
user
.
admin
=
!
admin
.
to_i
.
zero?
end
respond_to
do
|
format
|
if
user
.
update_attributes
(
params
[
:user
],
as: :admin
)
...
...
features/admin/users.feature
View file @
44013827
...
...
@@ -14,3 +14,9 @@ Feature: Admin Users
And
Click save
Then
See username error message
And
Not changed form action url
Scenario
:
Edit my user attributes
Given
I visit admin users page
And
click edit on my user
When
I submit modified user
Then
I see user attributes changed
features/steps/admin/admin_users.rb
View file @
44013827
...
...
@@ -31,4 +31,17 @@ class AdminUsers < Spinach::FeatureSteps
And
'Not changed form action url'
do
page
.
should
have_selector
%(form[action="/admin/users/#{@user.username}"])
end
step
'I submit modified user'
do
check
:user_can_create_group
click_button
'Save'
end
step
'I see user attributes changed'
do
page
.
should
have_content
'Can create groups: Yes'
end
step
'click edit on my user'
do
find
(
"#edit_user_
#{
current_user
.
id
}
"
).
click
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