Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-18 18:10:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-18 18:10:42 +0300
commitbfc7eec58ee891178d2a81c424f6c1de22feae5f (patch)
tree7cf9e2f76befc383e99d28d397ecec4bb9e8d2c9 /spec/routing
parentf23a9a17ed6237c346d2e9210c6841e319e8d030 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/routing')
-rw-r--r--spec/routing/notifications_routing_spec.rb8
-rw-r--r--spec/routing/project_routing_spec.rb24
-rw-r--r--spec/routing/routing_spec.rb92
3 files changed, 64 insertions, 60 deletions
diff --git a/spec/routing/notifications_routing_spec.rb b/spec/routing/notifications_routing_spec.rb
index 007e8ff4816..d66aa7f219f 100644
--- a/spec/routing/notifications_routing_spec.rb
+++ b/spec/routing/notifications_routing_spec.rb
@@ -4,15 +4,15 @@ require "spec_helper"
RSpec.describe "notifications routing" do
it "routes to #show" do
- expect(get("/profile/notifications")).to route_to("profiles/notifications#show")
+ expect(get("/-/profile/notifications")).to route_to("profiles/notifications#show")
end
it "routes to #update" do
- expect(put("/profile/notifications")).to route_to("profiles/notifications#update")
+ expect(put("/-/profile/notifications")).to route_to("profiles/notifications#update")
end
it 'routes to group #update' do
- expect(put("/profile/notifications/groups/gitlab-org")).to route_to("profiles/groups#update", id: 'gitlab-org')
- expect(put("/profile/notifications/groups/gitlab.org")).to route_to("profiles/groups#update", id: 'gitlab.org')
+ expect(put("/-/profile/notifications/groups/gitlab-org")).to route_to("profiles/groups#update", id: 'gitlab-org')
+ expect(put("/-/profile/notifications/groups/gitlab.org")).to route_to("profiles/groups#update", id: 'gitlab.org')
end
end
diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb
index a683dc28f4f..29e5c1b4bae 100644
--- a/spec/routing/project_routing_spec.rb
+++ b/spec/routing/project_routing_spec.rb
@@ -106,8 +106,8 @@ RSpec.describe 'project routing' do
let(:base_path) { '/gitlab/gitlabhq/-/wikis' }
end
- it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/wikis", "/gitlab/gitlabhq/-/wikis"
- it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/wikis/home/edit", "/gitlab/gitlabhq/-/wikis/home/edit"
+ it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/wikis", "/gitlab/gitlabhq/-/wikis"
+ it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/wikis/home/edit", "/gitlab/gitlabhq/-/wikis/home/edit"
end
# branches_project_repository GET /:project_id/repository/branches(.:format) projects/repositories#branches
@@ -171,7 +171,7 @@ RSpec.describe 'project routing' do
expect(delete('/gitlab/gitlabhq/-/tags/feature@45/foo/bar/baz')).to route_to('projects/tags#destroy', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature@45/foo/bar/baz')
end
- it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/tags", "/gitlab/gitlabhq/-/tags"
+ it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/tags", "/gitlab/gitlabhq/-/tags"
end
# project_deploy_keys GET /:project_id/deploy_keys(.:format) deploy_keys#index
@@ -259,8 +259,8 @@ RSpec.describe 'project routing' do
let(:base_path) { '/gitlab/gitlabhq/-/merge_requests' }
end
- it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/merge_requests", "/gitlab/gitlabhq/-/merge_requests"
- it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/merge_requests/1/diffs", "/gitlab/gitlabhq/-/merge_requests/1/diffs"
+ it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/merge_requests", "/gitlab/gitlabhq/-/merge_requests"
+ it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/merge_requests/1/diffs", "/gitlab/gitlabhq/-/merge_requests/1/diffs"
end
describe Projects::MergeRequests::CreationsController, 'routing' do
@@ -290,7 +290,7 @@ RSpec.describe 'project routing' do
expect(get('/gitlab/gitlabhq/-/merge_requests/new/diffs.json')).to route_to('projects/merge_requests/creations#diffs', namespace_id: 'gitlab', project_id: 'gitlabhq', format: 'json')
end
- it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/merge_requests/new", "/gitlab/gitlabhq/-/merge_requests/new"
+ it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/merge_requests/new", "/gitlab/gitlabhq/-/merge_requests/new"
end
describe Projects::MergeRequests::DiffsController, 'routing' do
@@ -454,8 +454,8 @@ RSpec.describe 'project routing' do
let(:base_path) { '/gitlab/gitlabhq/-/issues' }
end
- it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/issues", "/gitlab/gitlabhq/-/issues"
- it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/issues/1/edit", "/gitlab/gitlabhq/-/issues/1/edit"
+ it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/issues", "/gitlab/gitlabhq/-/issues"
+ it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/issues/1/edit", "/gitlab/gitlabhq/-/issues/1/edit"
end
# project_noteable_notes GET /:project_id/noteable/:target_type/:target_id/notes notes#index
@@ -769,25 +769,25 @@ RSpec.describe 'project routing' do
describe Projects::EnvironmentsController, 'routing' do
describe 'legacy routing' do
- it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/environments", "/gitlab/gitlabhq/-/environments"
+ it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/environments", "/gitlab/gitlabhq/-/environments"
end
end
describe Projects::ClustersController, 'routing' do
describe 'legacy routing' do
- it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/clusters", "/gitlab/gitlabhq/-/clusters"
+ it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/clusters", "/gitlab/gitlabhq/-/clusters"
end
end
describe Projects::ErrorTrackingController, 'routing' do
describe 'legacy routing' do
- it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/error_tracking", "/gitlab/gitlabhq/-/error_tracking"
+ it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/error_tracking", "/gitlab/gitlabhq/-/error_tracking"
end
end
describe Projects::Serverless, 'routing' do
describe 'legacy routing' do
- it_behaves_like 'redirecting a legacy project path', "/gitlab/gitlabhq/serverless", "/gitlab/gitlabhq/-/serverless"
+ it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/serverless", "/gitlab/gitlabhq/-/serverless"
end
end
diff --git a/spec/routing/routing_spec.rb b/spec/routing/routing_spec.rb
index 26ad1f14786..7b9ba783885 100644
--- a/spec/routing/routing_spec.rb
+++ b/spec/routing/routing_spec.rb
@@ -122,111 +122,115 @@ RSpec.describe HelpController, "routing" do
end
end
-# profile_account GET /profile/account(.:format) profile#account
-# profile_history GET /profile/history(.:format) profile#history
-# profile_password PUT /profile/password(.:format) profile#password_update
-# profile_token GET /profile/token(.:format) profile#token
-# profile GET /profile(.:format) profile#show
-# profile_update PUT /profile/update(.:format) profile#update
+# profile_account GET /-/profile/account(.:format) profile#account
+# profile_history GET /-/profile/history(.:format) profile#history
+# profile_password PUT /-/profile/password(.:format) profile#password_update
+# profile_token GET /-/profile/token(.:format) profile#token
+# profile GET /-/profile(.:format) profile#show
+# profile_update PUT /-/profile/update(.:format) profile#update
RSpec.describe ProfilesController, "routing" do
it "to #account" do
- expect(get("/profile/account")).to route_to('profiles/accounts#show')
+ expect(get("/-/profile/account")).to route_to('profiles/accounts#show')
end
+ it_behaves_like 'redirecting a legacy path', '/profile/account', '/-/profile/account'
it "to #audit_log" do
- expect(get("/profile/audit_log")).to route_to('profiles#audit_log')
+ expect(get("/-/profile/audit_log")).to route_to('profiles#audit_log')
end
+ it_behaves_like 'redirecting a legacy path', '/profile/audit_log', '/-/profile/audit_log'
it "to #reset_feed_token" do
- expect(put("/profile/reset_feed_token")).to route_to('profiles#reset_feed_token')
+ expect(put("/-/profile/reset_feed_token")).to route_to('profiles#reset_feed_token')
end
it "to #show" do
- expect(get("/profile")).to route_to('profiles#show')
- end
-
- it 'to #show from scope routing' do
expect(get("/-/profile")).to route_to('profiles#show')
end
+ it_behaves_like 'redirecting a legacy path', '/profile', '/-/profile'
end
-# profile_preferences GET /profile/preferences(.:format) profiles/preferences#show
-# PATCH /profile/preferences(.:format) profiles/preferences#update
-# PUT /profile/preferences(.:format) profiles/preferences#update
+# profile_preferences GET /-/profile/preferences(.:format) profiles/preferences#show
+# PATCH /-/profile/preferences(.:format) profiles/preferences#update
+# PUT /-/profile/preferences(.:format) profiles/preferences#update
RSpec.describe Profiles::PreferencesController, 'routing' do
it 'to #show' do
- expect(get('/profile/preferences')).to route_to('profiles/preferences#show')
+ expect(get('/-/profile/preferences')).to route_to('profiles/preferences#show')
end
+ it_behaves_like 'redirecting a legacy path', '/profile/preferences', '/-/profile/preferences'
it 'to #update' do
- expect(put('/profile/preferences')).to route_to('profiles/preferences#update')
- expect(patch('/profile/preferences')).to route_to('profiles/preferences#update')
+ expect(put('/-/profile/preferences')).to route_to('profiles/preferences#update')
+ expect(patch('/-/profile/preferences')).to route_to('profiles/preferences#update')
end
end
-# keys GET /keys(.:format) keys#index
-# POST /keys(.:format) keys#create
-# edit_key GET /keys/:id/edit(.:format) keys#edit
-# key GET /keys/:id(.:format) keys#show
-# PUT /keys/:id(.:format) keys#update
-# DELETE /keys/:id(.:format) keys#destroy
+# keys GET /-/profile/keys(.:format) keys#index
+# POST /-/profile/keys(.:format) keys#create
+# edit_key GET /-/profile/keys/:id/edit(.:format) keys#edit
+# key GET /-/profile/keys/:id(.:format) keys#show
+# PUT /-/profile/keys/:id(.:format) keys#update
+# DELETE /-/profile/keys/:id(.:format) keys#destroy
RSpec.describe Profiles::KeysController, "routing" do
it "to #index" do
- expect(get("/profile/keys")).to route_to('profiles/keys#index')
+ expect(get("/-/profile/keys")).to route_to('profiles/keys#index')
end
+ it_behaves_like 'redirecting a legacy path', '/profile/keys', '/-/profile/keys'
it "to #create" do
- expect(post("/profile/keys")).to route_to('profiles/keys#create')
+ expect(post("/-/profile/keys")).to route_to('profiles/keys#create')
end
it "to #show" do
- expect(get("/profile/keys/1")).to route_to('profiles/keys#show', id: '1')
+ expect(get("/-/profile/keys/1")).to route_to('profiles/keys#show', id: '1')
end
+ it_behaves_like 'redirecting a legacy path', '/profile/keys/1', '/-/profile/keys/1'
it "to #destroy" do
- expect(delete("/profile/keys/1")).to route_to('profiles/keys#destroy', id: '1')
+ expect(delete("/-/profile/keys/1")).to route_to('profiles/keys#destroy', id: '1')
end
end
-# keys GET /gpg_keys gpg_keys#index
-# key POST /gpg_keys gpg_keys#create
-# PUT /gpg_keys/:id gpg_keys#revoke
-# DELETE /gpg_keys/:id gpg_keys#desroy
+# keys GET /-/profile/gpg_keys gpg_keys#index
+# key POST /-/profile/gpg_keys gpg_keys#create
+# PUT /-/profile/gpg_keys/:id gpg_keys#revoke
+# DELETE /-/profile/gpg_keys/:id gpg_keys#desroy
RSpec.describe Profiles::GpgKeysController, "routing" do
it "to #index" do
- expect(get("/profile/gpg_keys")).to route_to('profiles/gpg_keys#index')
+ expect(get("/-/profile/gpg_keys")).to route_to('profiles/gpg_keys#index')
end
+ it_behaves_like 'redirecting a legacy path', '/profile/gpg_keys', '/-/profile/gpg_keys'
it "to #create" do
- expect(post("/profile/gpg_keys")).to route_to('profiles/gpg_keys#create')
+ expect(post("/-/profile/gpg_keys")).to route_to('profiles/gpg_keys#create')
end
it "to #destroy" do
- expect(delete("/profile/gpg_keys/1")).to route_to('profiles/gpg_keys#destroy', id: '1')
+ expect(delete("/-/profile/gpg_keys/1")).to route_to('profiles/gpg_keys#destroy', id: '1')
end
end
-# emails GET /emails(.:format) emails#index
-# POST /keys(.:format) emails#create
-# DELETE /keys/:id(.:format) keys#destroy
+# emails GET /-/profile/emails(.:format) emails#index
+# POST /-/profile/emails(.:format) emails#create
+# DELETE /-/profile/emails/:id(.:format) keys#destroy
RSpec.describe Profiles::EmailsController, "routing" do
it "to #index" do
- expect(get("/profile/emails")).to route_to('profiles/emails#index')
+ expect(get("/-/profile/emails")).to route_to('profiles/emails#index')
end
+ it_behaves_like 'redirecting a legacy path', '/profile/emails', '/-/profile/emails'
it "to #create" do
- expect(post("/profile/emails")).to route_to('profiles/emails#create')
+ expect(post("/-/profile/emails")).to route_to('profiles/emails#create')
end
it "to #destroy" do
- expect(delete("/profile/emails/1")).to route_to('profiles/emails#destroy', id: '1')
+ expect(delete("/-/profile/emails/1")).to route_to('profiles/emails#destroy', id: '1')
end
end
-# profile_avatar DELETE /profile/avatar(.:format) profiles/avatars#destroy
+# profile_avatar DELETE /-/profile/avatar(.:format) profiles/avatars#destroy
RSpec.describe Profiles::AvatarsController, "routing" do
it "to #destroy" do
- expect(delete("/profile/avatar")).to route_to('profiles/avatars#destroy')
+ expect(delete("/-/profile/avatar")).to route_to('profiles/avatars#destroy')
end
end