Commit a9c62fde authored by Doug Stull's avatar Doug Stull Committed by Bob Van Landuyt

Remove unused group links route

- not used except by a test...
parent 27b223d5
......@@ -5,10 +5,6 @@ class Projects::GroupLinksController < Projects::ApplicationController
before_action :authorize_admin_project!
before_action :authorize_admin_project_member!, only: [:update]
def index
redirect_to namespace_project_project_members_path
end
def create
group = Group.find(params[:link_group_id]) if params[:link_group_id].present?
......
......@@ -78,7 +78,7 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
delete :leave, on: :collection
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
collection do
......
......@@ -199,7 +199,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resources :starrers, only: [:index]
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 :avatar, only: [:show, :destroy]
......
......@@ -39,6 +39,8 @@ describe 'Project > Members > Invite group', :js do
it 'the project can be shared with another group' do
visit project_project_members_path(project)
expect(page).not_to have_css('.project-members-groups')
click_on 'invite-group-tab'
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