Commit 5f03c6ed authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch '218700-investigate-fix-broken-group-links-redirect' into 'master'

Remove unused group links index route

Closes #218700

See merge request gitlab-org/gitlab!33513
parents 2bc480bf a9c62fde
...@@ -5,10 +5,6 @@ class Projects::GroupLinksController < Projects::ApplicationController ...@@ -5,10 +5,6 @@ class Projects::GroupLinksController < Projects::ApplicationController
before_action :authorize_admin_project! before_action :authorize_admin_project!
before_action :authorize_admin_project_member!, only: [:update] before_action :authorize_admin_project_member!, only: [:update]
def index
redirect_to namespace_project_project_members_path
end
def create def create
group = Group.find(params[:link_group_id]) if params[:link_group_id].present? group = Group.find(params[:link_group_id]) if params[:link_group_id].present?
......
...@@ -78,7 +78,7 @@ constraints(::Constraints::GroupUrlConstrainer.new) do ...@@ -78,7 +78,7 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
delete :leave, on: :collection delete :leave, on: :collection
end end
resources :group_links, only: [:index, :create, :update, :destroy], constraints: { id: /\d+/ } resources :group_links, only: [:create, :update, :destroy], constraints: { id: /\d+/ }
resources :uploads, only: [:create] do resources :uploads, only: [:create] do
collection do collection do
......
...@@ -199,7 +199,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -199,7 +199,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resources :starrers, only: [:index] resources :starrers, only: [:index]
resources :forks, only: [:index, :new, :create] resources :forks, only: [:index, :new, :create]
resources :group_links, only: [:index, :create, :update, :destroy], constraints: { id: /\d+/ } resources :group_links, only: [:create, :update, :destroy], constraints: { id: /\d+/ }
resource :import, only: [:new, :create, :show] resource :import, only: [:new, :create, :show]
resource :avatar, only: [:show, :destroy] resource :avatar, only: [:show, :destroy]
......
...@@ -39,6 +39,8 @@ describe 'Project > Members > Invite group', :js do ...@@ -39,6 +39,8 @@ describe 'Project > Members > Invite group', :js do
it 'the project can be shared with another group' do it 'the project can be shared with another group' do
visit project_project_members_path(project) visit project_project_members_path(project)
expect(page).not_to have_css('.project-members-groups')
click_on 'invite-group-tab' click_on 'invite-group-tab'
select2 group_to_share_with.id, from: '#link_group_id' select2 group_to_share_with.id, from: '#link_group_id'
......
# frozen_string_literal: true
require 'spec_helper'
describe 'Projects > Settings > User manages group links' do
include Select2Helper
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
let(:group_ops) { create(:group, name: 'Ops') }
let(:group_market) { create(:group, name: 'Market', path: 'market') }
before do
project.add_maintainer(user)
group_market.add_guest(user)
sign_in(user)
share_link = project.project_group_links.new(group_access: Gitlab::Access::MAINTAINER)
share_link.group_id = group_ops.id
share_link.save!
visit(project_group_links_path(project))
end
it 'shows a list of groups' do
page.within('.project-members-groups') do
expect(page).to have_content('Ops')
expect(page).not_to have_content('Market')
end
end
it 'invites a group to a project', :js do
click_link('Invite group')
select2(group_market.id, from: '#link_group_id')
select('Maintainer', from: 'link_group_access')
click_button('Invite')
page.within('.project-members-groups') do
expect(page).to have_content('Market')
end
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