Commit 68e82347 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'dz-remove-deprecated-group-routes' into 'master'

Remove deprecated group routes

See merge request gitlab-org/gitlab-ee!14256
parents 43127929 b4892157
......@@ -113,12 +113,6 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
resource :dependency_proxy, only: [:show, :update]
resources :packages, only: [:index]
end
scope(path: 'groups/*group_id') do
Gitlab::Routing.redirect_legacy_paths(self, :analytics, :ldap, :ldap_group_links,
:notification_setting, :audit_events,
:pipeline_quota, :hooks, :boards)
end
end
# Dependency proxy for containers
......
require 'spec_helper'
describe 'Deprecated boards paths' do
let!(:group) { create(:group, name: 'gitlabhq') }
context 'when no group called boards exists' do
it 'redirects to boards page' do
get('/groups/gitlabhq/boards')
expect(response).to redirect_to('/groups/gitlabhq/-/boards')
end
it 'redirects to the boards page with additional params' do
get('/groups/gitlabhq/boards/1?foo=bar')
expect(response).to redirect_to(group_board_path(group, 1, foo: 'bar'))
end
end
context 'when a group called boards exists', :nested_groups do
before do
create(:group, name: 'boards', parent: group)
end
it 'does not redirect to the main boards page' do
get('/groups/gitlabhq/boards')
expect(response).to have_gitlab_http_status(200)
end
it 'does not redirect to the boards page with additional params' do
get('/groups/gitlabhq/boards/-/issues')
expect(response).to have_gitlab_http_status(200)
end
it 'redirects to the boards page with additional params if there is no matching route on the subgroup' do
get('/groups/gitlabhq/boards/1?foo=bar')
expect(response).to redirect_to(group_board_path(group, 1, foo: 'bar'))
end
end
end
......@@ -17,44 +17,6 @@ describe 'Group routing', "routing" do
end
end
describe 'legacy redirection' do
%w(analytics
boards
ldap
ldap_group_links
notification_setting
audit_events
pipeline_quota hooks).each do |legacy_reserved_path|
describe legacy_reserved_path do
it_behaves_like 'redirecting a legacy path',
"/groups/complex.group-namegit/#{legacy_reserved_path}",
"/groups/complex.group-namegit/-/#{legacy_reserved_path}" do
let!(:parent) { create(:group, path: 'complex.group-namegit') }
let(:resource) { create(:group, parent: parent, path: legacy_reserved_path) }
end
end
end
context 'multiple redirects' do
include RSpec::Rails::RequestExampleGroup
let!(:parent) { create(:group, path: 'complex.group-namegit') }
it 'follows multiple redirects' do
expect(get('/groups/complex.group-namegit/boards/issues'))
.to redirect_to('/groups/complex.group-namegit/-/boards/issues')
end
it 'does not redirect when the nested group exists' do
boards_group = create(:group, path: 'boards', parent: parent)
create(:group, path: 'issues', parent: boards_group)
expect(get('/groups/complex.group-namegit/boards/issues'))
.to eq(200)
end
end
end
describe 'security' do
it 'shows group dashboard' do
allow(Group).to receive(:find_by_full_path).with('gitlabhq', any_args).and_return(true)
......
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