diff options
author | Roger Rüttimann <roger.ruettimann@gmail.com> | 2018-05-01 12:24:21 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-05-01 12:24:21 +0300 |
commit | bc7877e8c15d9fb07824e00eeac20bb9c0f12997 (patch) | |
tree | 882e18f550a512911e045fa1ebd37738b7555481 /spec/features/dashboard | |
parent | 36043ab9f1ebe4f32e0d3192b74c902aec4f266a (diff) |
show only groups an admin is a member of in dashboards/grops
Diffstat (limited to 'spec/features/dashboard')
-rw-r--r-- | spec/features/dashboard/groups_list_spec.rb | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/spec/features/dashboard/groups_list_spec.rb b/spec/features/dashboard/groups_list_spec.rb index a71020002dc..ed47f7ed390 100644 --- a/spec/features/dashboard/groups_list_spec.rb +++ b/spec/features/dashboard/groups_list_spec.rb @@ -40,7 +40,7 @@ feature 'Dashboard Groups page', :js do expect(page).to have_content(nested_group.name) end - describe 'when filtering groups', :nested_groups do + context 'when filtering groups', :nested_groups do before do group.add_owner(user) nested_group.add_owner(user) @@ -75,7 +75,7 @@ feature 'Dashboard Groups page', :js do end end - describe 'group with subgroups', :nested_groups do + context 'with subgroups', :nested_groups do let!(:subgroup) { create(:group, :public, parent: group) } before do @@ -106,7 +106,7 @@ feature 'Dashboard Groups page', :js do end end - describe 'when using pagination' do + context 'when using pagination' do let(:group) { create(:group, created_at: 5.days.ago) } let(:group2) { create(:group, created_at: 2.days.ago) } @@ -141,4 +141,20 @@ feature 'Dashboard Groups page', :js do expect(page).not_to have_selector("#group-#{group2.id}") end end + + context 'when signed in as admin' do + let(:admin) { create(:admin) } + + it 'shows only groups admin is member of' do + group.add_owner(admin) + expect(another_group).to be_persisted + + sign_in(admin) + visit dashboard_groups_path + wait_for_requests + + expect(page).to have_content(group.name) + expect(page).not_to have_content(another_group.name) + end + end end |