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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
ffbd9cd0
Commit
ffbd9cd0
authored
Jun 02, 2016
by
Annabel Dunstone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test impersonation using img data attribute instead of username
parent
7c501895
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
app/views/layouts/_page.html.haml
app/views/layouts/_page.html.haml
+1
-1
spec/features/admin/admin_users_spec.rb
spec/features/admin/admin_users_spec.rb
+4
-4
No files found.
app/views/layouts/_page.html.haml
View file @
ffbd9cd0
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
.collapse-nav
.collapse-nav
=
render
partial:
'layouts/collapse_button'
=
render
partial:
'layouts/collapse_button'
-
if
current_user
-
if
current_user
=
link_to
current_user
,
class:
'sidebar-user'
,
title:
"Profile"
do
=
link_to
current_user
,
class:
'sidebar-user'
,
title:
"Profile"
,
data:
{
user:
current_user
.
username
}
do
=
image_tag
avatar_icon
(
current_user
,
60
),
alt:
'Profile'
,
class:
'avatar avatar s46'
=
image_tag
avatar_icon
(
current_user
,
60
),
alt:
'Profile'
,
class:
'avatar avatar s46'
-
if
defined?
(
nav
)
&&
nav
-
if
defined?
(
nav
)
&&
nav
.layout-nav
.layout-nav
...
...
spec/features/admin/admin_users_spec.rb
View file @
ffbd9cd0
...
@@ -144,8 +144,8 @@ describe "Admin::Users", feature: true do
...
@@ -144,8 +144,8 @@ describe "Admin::Users", feature: true do
before
{
click_link
'Impersonate'
}
before
{
click_link
'Impersonate'
}
it
'logs in as the user when impersonate is clicked'
do
it
'logs in as the user when impersonate is clicked'
do
page
.
within
'.sidebar-
user .username
'
do
page
.
within
'.sidebar-
wrapper
'
do
expect
(
page
).
to
have_content
(
another_user
.
username
)
expect
(
page
.
find
(
'.sidebar-user'
)[
'data-user'
]).
to
eql
(
another_user
.
username
)
end
end
end
end
...
@@ -158,8 +158,8 @@ describe "Admin::Users", feature: true do
...
@@ -158,8 +158,8 @@ describe "Admin::Users", feature: true do
it
'can log out of impersonated user back to original user'
do
it
'can log out of impersonated user back to original user'
do
find
(
:css
,
'li.impersonation a'
).
click
find
(
:css
,
'li.impersonation a'
).
click
page
.
within
'.sidebar-
user .username
'
do
page
.
within
'.sidebar-
wrapper
'
do
expect
(
page
).
to
have_content
(
@user
.
username
)
expect
(
page
.
find
(
'.sidebar-user'
)[
'data-user'
]).
to
eql
(
@user
.
username
)
end
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