Commit cc7052f6 authored by Michael Kozono's avatar Michael Kozono

Merge branch 'dz-scope-snippet-routes' into 'master'

Copy snippet route under - scope

See merge request gitlab-org/gitlab!35020
parents d69392f5 3c434a8e
---
title: Copy snippet route under - scope
merge_request: 35020
author:
type: other
......@@ -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'
......
......@@ -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
......
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