From e9d57390d6d2323d9db29b0544f7b76f30755de8 Mon Sep 17 00:00:00 2001 From: Dmytro Zaporozhets Date: Thu, 15 Oct 2020 20:01:23 +0300 Subject: [PATCH] Use scoped profile routes by default --- config/routes.rb | 9 +-------- .../dashboard_operations_project_entity_spec.rb | 2 +- spec/features/profiles/account_spec.rb | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 87d32e3d89a9a1..ef718c7618af31 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -180,6 +180,7 @@ get 'jwks' => 'doorkeeper/openid_connect/discovery#keys' draw :snippets + draw :profile # Product analytics collector match '/collector/i', to: ProductAnalytics::CollectorApp.new, via: :all @@ -266,7 +267,6 @@ draw :uploads draw :explore draw :admin - draw :profile draw :dashboard draw :user draw :project @@ -274,13 +274,6 @@ # Issue https://gitlab.com/gitlab-org/gitlab/-/issues/210024 scope as: 'deprecated' do draw :snippets - end - - # Serve profile routes under /-/ scope. - # To ensure an old unscoped routing is used for the UI we need to - # add prefix 'as' to the scope routing and place it below original routing. - # Issue https://gitlab.com/gitlab-org/gitlab/-/issues/210024 - scope '-', as: :scoped do draw :profile end diff --git a/ee/spec/serializers/dashboard_operations_project_entity_spec.rb b/ee/spec/serializers/dashboard_operations_project_entity_spec.rb index 9959661ce11e92..cd182a32a905af 100644 --- a/ee/spec/serializers/dashboard_operations_project_entity_spec.rb +++ b/ee/spec/serializers/dashboard_operations_project_entity_spec.rb @@ -99,7 +99,7 @@ let(:user) { build(:user, :admin) } it 'shows the profile upgrade path' do - expect(subject[:upgrade_path]).to eq '/profile/billings' + expect(subject[:upgrade_path]).to eq '/-/profile/billings' end end diff --git a/spec/features/profiles/account_spec.rb b/spec/features/profiles/account_spec.rb index e8caa2159a45f0..13ec12c50ead53 100644 --- a/spec/features/profiles/account_spec.rb +++ b/spec/features/profiles/account_spec.rb @@ -33,7 +33,7 @@ end it 'allows the user to disconnect when there is an existing identity' do - expect(page).to have_link('Disconnect Twitter', href: '/profile/account/unlink?provider=twitter') + expect(page).to have_link('Disconnect Twitter', href: '/-/profile/account/unlink?provider=twitter') end it 'shows active for a provider that is not allowed to unlink' do -- GitLab