From a945ab6d36ba8065df34471290363aab95e50400 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 18 Jun 2019 17:18:34 +0300 Subject: [PATCH 1/2] Remove spec for legacy group routes Signed-off-by: Dmitriy Zaporozhets --- ee/spec/routing/group_routing_spec.rb | 38 --------------------------- 1 file changed, 38 deletions(-) diff --git a/ee/spec/routing/group_routing_spec.rb b/ee/spec/routing/group_routing_spec.rb index 9d435dfc710b98..2dca469dcbb65f 100644 --- a/ee/spec/routing/group_routing_spec.rb +++ b/ee/spec/routing/group_routing_spec.rb @@ -17,44 +17,6 @@ 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) -- GitLab From b4892157cd20a70a1ed351533ef4a23651a9c3b2 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 18 Jun 2019 17:20:46 +0300 Subject: [PATCH 2/2] Remove legacy ee routes Remove legacy group routes that are EE only Signed-off-by: Dmitriy Zaporozhets --- ee/config/routes/group.rb | 6 ---- ee/spec/requests/group_routing_spec.rb | 43 -------------------------- 2 files changed, 49 deletions(-) delete mode 100644 ee/spec/requests/group_routing_spec.rb diff --git a/ee/config/routes/group.rb b/ee/config/routes/group.rb index d1abb52efb4724..8811b60cca26e9 100644 --- a/ee/config/routes/group.rb +++ b/ee/config/routes/group.rb @@ -112,12 +112,6 @@ resource :dependency_proxy, only: [:show, :update] 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 diff --git a/ee/spec/requests/group_routing_spec.rb b/ee/spec/requests/group_routing_spec.rb deleted file mode 100644 index 978404b5a06443..00000000000000 --- a/ee/spec/requests/group_routing_spec.rb +++ /dev/null @@ -1,43 +0,0 @@ -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 -- GitLab