diff options
author | Jose Ivan Vargas Lopez <jvargas@gitlab.com> | 2017-03-24 01:40:36 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2017-03-24 01:40:36 +0300 |
commit | 29e5ae8cd7aef90123ae230321d5ec46e96b9fbe (patch) | |
tree | 346e5a464b0d7f0809e2e14181885858e5701bd1 | |
parent | 6eeba4b18214e054bbdebd66f53586fc09256130 (diff) |
Fix usercallout to only show on the current logged in user profile
-rw-r--r-- | app/views/users/show.html.haml | 3 | ||||
-rw-r--r-- | changelogs/unreleased/user-callout-showing-on-all-profiles.yml | 4 | ||||
-rw-r--r-- | spec/features/user_callout_spec.rb | 8 |
3 files changed, 13 insertions, 2 deletions
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 270886733cb..57125f36ed6 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -97,7 +97,8 @@ Snippets %div{ class: container_class } - .user-callout{ 'callout-svg' => custom_icon('icon_customization') } + - if @user == current_user + .user-callout{ 'callout-svg' => custom_icon('icon_customization') } .tab-content #activity.tab-pane .row-content-block.calender-block.white.second-block.hidden-xs diff --git a/changelogs/unreleased/user-callout-showing-on-all-profiles.yml b/changelogs/unreleased/user-callout-showing-on-all-profiles.yml new file mode 100644 index 00000000000..b8eb5a149b7 --- /dev/null +++ b/changelogs/unreleased/user-callout-showing-on-all-profiles.yml @@ -0,0 +1,4 @@ +--- +title: User callout only shows on current users profile +merge_request: +author: diff --git a/spec/features/user_callout_spec.rb b/spec/features/user_callout_spec.rb index 336c4092c98..659cd7c7af7 100644 --- a/spec/features/user_callout_spec.rb +++ b/spec/features/user_callout_spec.rb @@ -2,6 +2,7 @@ require 'spec_helper' describe 'User Callouts', js: true do let(:user) { create(:user) } + let(:another_user) { create(:user) } let(:project) { create(:empty_project, path: 'gitlab', name: 'sample') } before do @@ -32,6 +33,11 @@ describe 'User Callouts', js: true do within('.user-callout') do find('.close-user-callout').click end - expect(page).not_to have_selector('#user-callout') + expect(page).not_to have_selector('.user-callout') + end + + it 'does not show callout on another users profile' do + visit user_path(another_user) + expect(page).not_to have_selector('.user-callout') end end |