Commit 540da508ffca41633b65b6172b0ad54dec345c0c
Exists in
spb-stable
and in
3 other branches
Merge pull request #6267 from robertd/feature-groups-on-profile-screen
Show avatars of groups on profile screen that user belongs to
Showing
6 changed files
with
36 additions
and
0 deletions
Show diff stats
app/assets/javascripts/profile.js.coffee
| @@ -26,3 +26,5 @@ $ -> | @@ -26,3 +26,5 @@ $ -> | ||
| 26 | form = $(this).closest("form") | 26 | form = $(this).closest("form") |
| 27 | filename = $(this).val().replace(/^.*[\\\/]/, '') | 27 | filename = $(this).val().replace(/^.*[\\\/]/, '') |
| 28 | form.find(".js-avatar-filename").text(filename) | 28 | form.find(".js-avatar-filename").text(filename) |
| 29 | + | ||
| 30 | + $('.profile-groups-avatars').tooltip("placement": "top") | ||
| 29 | \ No newline at end of file | 31 | \ No newline at end of file |
app/assets/stylesheets/sections/profile.scss
app/views/users/show.html.haml
| @@ -13,6 +13,8 @@ | @@ -13,6 +13,8 @@ | ||
| 13 | %br | 13 | %br |
| 14 | %small member since #{@user.created_at.stamp("Nov 12, 2031")} | 14 | %small member since #{@user.created_at.stamp("Nov 12, 2031")} |
| 15 | .clearfix | 15 | .clearfix |
| 16 | + %h4 Groups: | ||
| 17 | + = render 'groups', groups: @user.groups | ||
| 16 | %hr | 18 | %hr |
| 17 | %h4 User Activity: | 19 | %h4 User Activity: |
| 18 | = render @events | 20 | = render @events |
features/profile/profile.feature
| @@ -6,6 +6,13 @@ Feature: Profile | @@ -6,6 +6,13 @@ Feature: Profile | ||
| 6 | Given I visit profile page | 6 | Given I visit profile page |
| 7 | Then I should see my profile info | 7 | Then I should see my profile info |
| 8 | 8 | ||
| 9 | + Scenario: I can see groups I belong to | ||
| 10 | + Given I have group with projects | ||
| 11 | + When I visit profile page | ||
| 12 | + And I click on my profile picture | ||
| 13 | + Then I should see my user page | ||
| 14 | + And I should see groups I belong to | ||
| 15 | + | ||
| 9 | Scenario: I edit profile | 16 | Scenario: I edit profile |
| 10 | Given I visit profile page | 17 | Given I visit profile page |
| 11 | Then I change my profile info | 18 | Then I change my profile info |
features/steps/profile/profile.rb
| @@ -173,4 +173,17 @@ class Profile < Spinach::FeatureSteps | @@ -173,4 +173,17 @@ class Profile < Spinach::FeatureSteps | ||
| 173 | page.should have_content current_user.name | 173 | page.should have_content current_user.name |
| 174 | end | 174 | end |
| 175 | end | 175 | end |
| 176 | + | ||
| 177 | + step 'I have group with projects' do | ||
| 178 | + @group = create(:group) | ||
| 179 | + @group.add_owner(current_user) | ||
| 180 | + @project = create(:project, namespace: @group) | ||
| 181 | + @event = create(:closed_issue_event, project: @project) | ||
| 182 | + | ||
| 183 | + @project.team << [current_user, :master] | ||
| 184 | + end | ||
| 185 | + | ||
| 186 | + step 'I should see groups I belong to' do | ||
| 187 | + page.should have_css('.profile-groups-avatars', visible: true) | ||
| 188 | + end | ||
| 176 | end | 189 | end |