Commit a1834ea7 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'dz-scope-project-routes-only-ee' into 'master'

Move some EE project routes under /-/ scope

See merge request gitlab-org/gitlab-ee!13912
parents 37e0c945 176de340
......@@ -9,37 +9,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
module: :projects,
as: :project) do
resource :tracing, only: [:show]
resources :autocomplete_sources, only: [] do
collection do
get 'epics'
end
end
resources :web_ide_terminals, path: :ide_terminals, only: [:create, :show], constraints: { id: /\d+/, format: :json } do
member do
post :cancel
post :retry
end
collection do
post :check_config
end
end
resources :merge_requests, only: [], constraints: { id: /\d+/ } do
member do
get :metrics_reports
end
end
resource :insights, only: [:show] do
collection do
post :query
end
end
# Begin of the /-/ scope.
# Use this scope for all new project routes.
scope '-' do
resources :boards, only: [:create, :update, :destroy] do
collection do
......@@ -64,25 +35,55 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resource :feature_flags_client, only: [] do
post :reset_token
end
end
resources :dependencies, only: [:index]
resources :autocomplete_sources, only: [] do
collection do
get 'epics'
end
end
namespace :settings do
resource :operations, only: [:show, :update] do
member do
post :reset_alerting_token
namespace :settings do
resource :operations, only: [:show, :update] do
member do
post :reset_alerting_token
end
end
end
end
scope '-' do
resources :designs, only: [], constraints: { id: /\d+/ } do
member do
get '(*ref)', action: 'show', as: '', constraints: { ref: Gitlab::PathRegex.git_reference_regex }
end
end
end
# End of the /-/ scope.
resource :tracing, only: [:show]
resources :web_ide_terminals, path: :ide_terminals, only: [:create, :show], constraints: { id: /\d+/, format: :json } do
member do
post :cancel
post :retry
end
collection do
post :check_config
end
end
resources :merge_requests, only: [], constraints: { id: /\d+/ } do
member do
get :metrics_reports
end
end
resource :insights, only: [:show] do
collection do
post :query
end
end
resources :dependencies, only: [:index]
end
end
end
......
......@@ -36,4 +36,16 @@ describe 'EE-specific project routing' do
expect(get('/gitlab/gitlabhq/-/designs/1/f166f5c7afaed9e1236e4e5965585f235795db4c3f45e8a9f6ea9dde098c')).to route_to('projects/designs#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', ref: 'f166f5c7afaed9e1236e4e5965585f235795db4c3f45e8a9f6ea9dde098c')
end
end
describe Projects::AutocompleteSourcesController, 'routing' do
it "to #epics" do
expect(get("/gitlab/gitlabhq/-/autocomplete_sources/epics")).to route_to("projects/autocomplete_sources#epics", namespace_id: 'gitlab', project_id: 'gitlabhq')
end
end
describe Projects::Settings::OperationsController, 'routing' do
it 'to #reset_alerting_token' do
expect(post('/gitlab/gitlabhq/-/settings/operations/reset_alerting_token')).to route_to('projects/settings/operations#reset_alerting_token', namespace_id: 'gitlab', project_id: 'gitlabhq')
end
end
end
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