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
cf129d6f
Commit
cf129d6f
authored
Feb 26, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '6-6-3-patch' into '6-6-stable'
6.6.3 Patch Fixes 500 error when try to edit own user via admin area
parents
4ef83692
98f4665e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
2 deletions
+24
-2
users_controller.rb
app/controllers/admin/users_controller.rb
+3
-1
users_controller.rb
app/controllers/users_controller.rb
+1
-0
show.html.haml
app/views/users/show.html.haml
+1
-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 @
cf129d6f
...
...
@@ -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
)
...
...
app/controllers/users_controller.rb
View file @
cf129d6f
...
...
@@ -11,6 +11,7 @@ class UsersController < ApplicationController
end
@events
=
@user
.
recent_events
.
where
(
project_id:
@projects
.
map
(
&
:id
)).
limit
(
20
)
@title
=
@user
.
name
@groups
=
@projects
.
map
(
&
:group
).
compact
.
uniq
end
def
determine_layout
...
...
app/views/users/show.html.haml
View file @
cf129d6f
...
...
@@ -14,7 +14,7 @@
%small
member since
#{
@user
.
created_at
.
stamp
(
"Nov 12, 2031"
)
}
.clearfix
%h4
Groups:
=
render
'groups'
,
groups:
@
user
.
groups
=
render
'groups'
,
groups:
@
groups
%hr
%h4
User Activity:
=
render
@events
...
...
features/admin/users.feature
View file @
cf129d6f
...
...
@@ -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 @
cf129d6f
...
...
@@ -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