Commit 376a8c66 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Remove the subgroups path on a group

parent 2eac1537
...@@ -60,11 +60,7 @@ class GroupsController < Groups::ApplicationController ...@@ -60,11 +60,7 @@ class GroupsController < Groups::ApplicationController
end end
end end
def subgroups
return not_found unless Group.supports_nested_groups?
@nested_groups = GroupsFinder.new(current_user, parent: group).execute
@nested_groups = @nested_groups.search(params[:filter_groups]) if params[:filter_groups].present?
end end
def activity def activity
......
- breadcrumb_title "Details"
- @no_container = true
= render 'groups/home_panel'
.groups-header{ class: container_class }
.top-area
= render 'groups/show_nav'
.nav-controls
= form_tag request.path, method: :get do |f|
= search_field_tag :filter_groups, params[:filter_groups], placeholder: 'Filter by name', class: 'form-control', spellcheck: false
- if can?(current_user, :create_subgroup, @group)
= link_to new_group_path(parent_id: @group.id), class: 'btn btn-new pull-right' do
New Subgroup
- if @nested_groups.present?
%ul.content-list
= render partial: 'shared/groups/group', collection: @nested_groups, locals: { full_name: false }
- else
.nothing-here-block
There are no subgroups to show.
...@@ -41,7 +41,6 @@ scope(path: 'groups/*id', ...@@ -41,7 +41,6 @@ scope(path: 'groups/*id',
get :merge_requests, as: :merge_requests_group get :merge_requests, as: :merge_requests_group
get :projects, as: :projects_group get :projects, as: :projects_group
get :activity, as: :activity_group get :activity, as: :activity_group
get :subgroups, as: :subgroups_group
get '/', action: :show, as: :group_canonical get '/', action: :show, as: :group_canonical
end end
......
...@@ -157,6 +157,7 @@ describe GroupsController do ...@@ -157,6 +157,7 @@ describe GroupsController do
context 'as a user' do context 'as a user' do
before do before do
sign_in(user) sign_in(user)
pending('spec the children path instead')
end end
it 'shows all subgroups' do it 'shows all subgroups' do
......
...@@ -90,7 +90,10 @@ feature 'Group' do ...@@ -90,7 +90,10 @@ feature 'Group' do
context 'as admin' do context 'as admin' do
before do before do
visit subgroups_group_path(group) visit group_path(group)
pending('use the new subgroup button')
click_link 'New Subgroup' click_link 'New Subgroup'
end end
...@@ -111,7 +114,10 @@ feature 'Group' do ...@@ -111,7 +114,10 @@ feature 'Group' do
sign_out(:user) sign_out(:user)
sign_in(user) sign_in(user)
visit subgroups_group_path(group) visit group_path(group)
pending('use the new subgroup button')
click_link 'New Subgroup' click_link 'New Subgroup'
fill_in 'Group path', with: 'bar' fill_in 'Group path', with: 'bar'
click_button 'Create group' click_button 'Create group'
...@@ -120,16 +126,6 @@ feature 'Group' do ...@@ -120,16 +126,6 @@ feature 'Group' do
expect(page).to have_content("Group 'bar' was successfully created.") expect(page).to have_content("Group 'bar' was successfully created.")
end end
end end
context 'when nested group feature is disabled' do
it 'renders 404' do
allow(Group).to receive(:supports_nested_groups?).and_return(false)
visit subgroups_group_path(group)
expect(page.status_code).to eq(404)
end
end
end end
it 'checks permissions to avoid exposing groups by parent_id' do it 'checks permissions to avoid exposing groups by parent_id' do
...@@ -213,8 +209,8 @@ feature 'Group' do ...@@ -213,8 +209,8 @@ feature 'Group' do
let!(:path) { group_path(group) } let!(:path) { group_path(group) }
it 'has nested groups tab with nested groups inside' do it 'has nested groups tab with nested groups inside' do
pending('the child should be visible on the show page')
visit path visit path
click_link 'Subgroups'
expect(page).to have_content(nested_group.name) expect(page).to have_content(nested_group.name)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment