diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-07-05 15:10:46 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-07-05 15:10:46 +0300 |
commit | 2df6a5b7a6c92e1f978daf25a61311be82b3c78d (patch) | |
tree | a4b072b4bba3ec6294e6e501e97e97bb53231d78 | |
parent | ba128f1d6e9aecb524235f1ffcb8c36eefd12ec1 (diff) | |
download | gitlab-ce-dz-remove-profile-sidebar.tar.gz |
Set user data in profile link in the headerdz-remove-profile-sidebar
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r-- | app/views/layouts/header/_default.html.haml | 2 | ||||
-rw-r--r-- | spec/features/admin/admin_users_spec.rb | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index d59a93a8fd7..86b9f6341db 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -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.divider %li = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link", title: 'Sign out' diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb index 1cb709c1de3..767504df251 100644 --- a/spec/features/admin/admin_users_spec.rb +++ b/spec/features/admin/admin_users_spec.rb @@ -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 |