diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-09-05 11:03:43 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-04 23:46:49 +0300 |
commit | 376a8c66c1ca8ee2a95255d21c9d55ce006ab655 (patch) | |
tree | d089b7830874490529380509caa830266c1d13e4 | |
parent | 2eac1537ad907f2f7e628788cf980cb7e48d3f56 (diff) |
Remove the subgroups path on a group
-rw-r--r-- | app/controllers/groups_controller.rb | 4 | ||||
-rw-r--r-- | app/views/groups/subgroups.html.haml | 21 | ||||
-rw-r--r-- | config/routes/group.rb | 1 | ||||
-rw-r--r-- | spec/controllers/groups_controller_spec.rb | 1 | ||||
-rw-r--r-- | spec/features/groups_spec.rb | 22 |
5 files changed, 10 insertions, 39 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 588995ab5a8..b8def9f5812 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -60,11 +60,7 @@ class GroupsController < Groups::ApplicationController 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 def activity diff --git a/app/views/groups/subgroups.html.haml b/app/views/groups/subgroups.html.haml deleted file mode 100644 index 869b3b243c6..00000000000 --- a/app/views/groups/subgroups.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -- 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. diff --git a/config/routes/group.rb b/config/routes/group.rb index 23052a6c6dc..e71a3c3b190 100644 --- a/config/routes/group.rb +++ b/config/routes/group.rb @@ -41,7 +41,6 @@ scope(path: 'groups/*id', get :merge_requests, as: :merge_requests_group get :projects, as: :projects_group get :activity, as: :activity_group - get :subgroups, as: :subgroups_group get '/', action: :show, as: :group_canonical end diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb index b0564e27a68..83a2e82d78c 100644 --- a/spec/controllers/groups_controller_spec.rb +++ b/spec/controllers/groups_controller_spec.rb @@ -157,6 +157,7 @@ describe GroupsController do context 'as a user' do before do sign_in(user) + pending('spec the children path instead') end it 'shows all subgroups' do diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb index 4ec2e7e6012..493dd551d25 100644 --- a/spec/features/groups_spec.rb +++ b/spec/features/groups_spec.rb @@ -90,7 +90,10 @@ feature 'Group' do context 'as admin' do before do - visit subgroups_group_path(group) + visit group_path(group) + + pending('use the new subgroup button') + click_link 'New Subgroup' end @@ -111,7 +114,10 @@ feature 'Group' do sign_out(:user) sign_in(user) - visit subgroups_group_path(group) + visit group_path(group) + + pending('use the new subgroup button') + click_link 'New Subgroup' fill_in 'Group path', with: 'bar' click_button 'Create group' @@ -120,16 +126,6 @@ feature 'Group' do expect(page).to have_content("Group 'bar' was successfully created.") 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 it 'checks permissions to avoid exposing groups by parent_id' do @@ -213,8 +209,8 @@ feature 'Group' do let!(:path) { group_path(group) } it 'has nested groups tab with nested groups inside' do + pending('the child should be visible on the show page') visit path - click_link 'Subgroups' expect(page).to have_content(nested_group.name) end |