From c41805f60e6b0fe97ca545a1ac99cbb1e0406100 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 2 Oct 2014 17:14:42 +0300 Subject: [PATCH 1/2] Add test for broken admin user page Signed-off-by: Dmitriy Zaporozhets --- features/admin/users.feature | 6 ++++++ features/steps/admin/users.rb | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/features/admin/users.feature b/features/admin/users.feature index d8c1288e5f0..278f6a43e94 100644 --- a/features/admin/users.feature +++ b/features/admin/users.feature @@ -16,6 +16,12 @@ Feature: Admin Users Then See username error message And Not changed form action url + Scenario: Show user attributes + Given user "Mike" with groups and projects + Given I visit admin users page + And click on "Mike" link + Then I should see user "Mike" details + Scenario: Edit my user attributes Given I visit admin users page And click edit on my user diff --git a/features/steps/admin/users.rb b/features/steps/admin/users.rb index 3422dc2b5af..546c1bf2a12 100644 --- a/features/steps/admin/users.rb +++ b/features/steps/admin/users.rb @@ -63,4 +63,23 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps step 'I should not see secondary email anymore' do page.should_not have_content "Secondary email:" end + + step 'user "Mike" with groups and projects' do + user = create(:user, name: 'Mike') + + project = create(:empty_project) + project.team << [user, :developer] + + group = create(:group) + group.add_user(user, Gitlab::Access::DEVELOPER) + end + + step 'click on "Mike" link' do + click_link "Mike" + end + + step 'I should see user "Mike" details' do + page.should have_content 'Account' + page.should have_content 'Personal projects limit' + end end From 929678899d462e4a43f66c256621144ea65ff630 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 2 Oct 2014 17:15:09 +0300 Subject: [PATCH 2/2] Fix 500 error on admin user page Signed-off-by: Dmitriy Zaporozhets --- app/views/admin/users/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index a172d12edb1..3883d95e138 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -171,7 +171,7 @@ .pull-right %span.light= user_group.human_access - unless user_group.owner? - = link_to group_users_group_path(group, user_group), data: { confirm: remove_user_from_group_message(group, @user) }, method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do + = link_to group_group_member_path(group, user_group), data: { confirm: remove_user_from_group_message(group, @user) }, method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do %i.icon-remove.icon-white - else .nothing-here-block This user has no groups.