Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3c434a8e
Commit
3c434a8e
authored
Jun 22, 2020
by
Dmytro Zaporozhets
Committed by
Michael Kozono
Jun 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copy snippet route under - scope
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
d0981554
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
changelogs/unreleased/dz-scope-snippet-routes.yml
changelogs/unreleased/dz-scope-snippet-routes.yml
+5
-0
config/routes.rb
config/routes.rb
+8
-0
spec/routing/routing_spec.rb
spec/routing/routing_spec.rb
+4
-0
No files found.
changelogs/unreleased/dz-scope-snippet-routes.yml
0 → 100644
View file @
3c434a8e
---
title
:
Copy snippet route under - scope
merge_request
:
35020
author
:
type
:
other
config/routes.rb
View file @
3c434a8e
...
...
@@ -262,6 +262,14 @@ Rails.application.routes.draw do
draw
:user
draw
:project
# Serve snippet routes under /-/snippets.
# 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
:snippets
end
root
to:
"root#index"
get
'*unmatched_route'
,
to:
'application#route_not_found'
...
...
spec/routing/routing_spec.rb
View file @
3c434a8e
...
...
@@ -99,6 +99,10 @@ describe SnippetsController, "routing" do
it
"to #destroy"
do
expect
(
delete
(
"/snippets/1"
)).
to
route_to
(
'snippets#destroy'
,
id:
'1'
)
end
it
'to #show from scope routing'
do
expect
(
get
(
"/-/snippets/1"
)).
to
route_to
(
'snippets#show'
,
id:
'1'
)
end
end
# help GET /help(.:format) help#index
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment