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
05e72272
Commit
05e72272
authored
Jul 05, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set user data in profile link in the header
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
7facedfb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
app/views/layouts/header/_default.html.haml
app/views/layouts/header/_default.html.haml
+1
-1
spec/features/admin/admin_users_spec.rb
spec/features/admin/admin_users_spec.rb
+2
-6
No files found.
app/views/layouts/header/_default.html.haml
View file @
05e72272
...
...
@@ -45,7 +45,7 @@
.dropdown-menu-nav.dropdown-menu-align-right
%ul
%li
=
link_to
"Profile"
,
current_user
=
link_to
"Profile"
,
current_user
,
class:
'profile-link'
,
data:
{
user:
current_user
.
username
}
%li
=
link_to
"Profile Settings"
,
profile_path
%li
.divider
...
...
spec/features/admin/admin_users_spec.rb
View file @
05e72272
...
...
@@ -144,9 +144,7 @@ describe "Admin::Users", feature: true do
before
{
click_link
'Impersonate'
}
it
'logs in as the user when impersonate is clicked'
do
page
.
within
'.sidebar-wrapper'
do
expect
(
page
.
find
(
'.sidebar-user'
)[
'data-user'
]).
to
eql
(
another_user
.
username
)
end
expect
(
page
.
find
(
:css
,
'.header-user .profile-link'
)[
'data-user'
]).
to
eql
(
another_user
.
username
)
end
it
'sees impersonation log out icon'
do
...
...
@@ -158,9 +156,7 @@ describe "Admin::Users", feature: true do
it
'can log out of impersonated user back to original user'
do
find
(
:css
,
'li.impersonation a'
).
click
page
.
within
'.sidebar-wrapper'
do
expect
(
page
.
find
(
'.sidebar-user'
)[
'data-user'
]).
to
eql
(
@user
.
username
)
end
expect
(
page
.
find
(
:css
,
'.header-user .profile-link'
)[
'data-user'
]).
to
eql
(
@user
.
username
)
end
it
'is redirected back to the impersonated users page in the admin after stopping'
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