Commit 1d7ac164 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'fix-help-paths' into 'master'

Fix help page paths to make sure shortcuts and the UI help page work.

Add a test to make sure the help page UI path doesn't break in the future.

Fixes #19972 and #19889.

cc: @dzaporozhets @rspeicher @lbennett 

See merge request !5350
parents 81e57e78 16a8160e
......@@ -89,11 +89,10 @@ Rails.application.routes.draw do
mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\/(info\/lfs|gitlab-lfs)/.match(request.path_info) }, via: [:get, :post, :put]
# Help
get 'help' => 'help#index'
get 'help/*path' => 'help#show', as: :help_page
get 'help/shortcuts'
get 'help/ui' => 'help#ui'
get 'help' => 'help#index'
get 'help/shortcuts' => 'help#shortcuts'
get 'help/ui' => 'help#ui'
get 'help/*path' => 'help#show', as: :help_page
#
# Global snippets
......
......@@ -5,7 +5,7 @@ module Gitlab
gon.default_avatar_url = URI::join(Gitlab.config.gitlab.url, ActionController::Base.helpers.image_path('no_avatar.png')).to_s
gon.max_file_size = current_application_settings.max_attachment_size
gon.relative_url_root = Gitlab.config.gitlab.relative_url_root
gon.shortcuts_path = help_shortcuts_path
gon.shortcuts_path = help_page_path('shortcuts')
gon.user_color_scheme = Gitlab::ColorSchemes.for_user(current_user).css_class
gon.award_menu_url = emojis_path
......
......@@ -63,4 +63,13 @@ describe HelpController do
end
end
end
describe 'GET #ui' do
context 'for UI Development Kit' do
it 'renders found' do
get :ui
expect(response).to have_http_status(200)
end
end
end
end
......@@ -116,12 +116,9 @@ describe HelpController, "routing" do
expect(get(path)).to route_to('help#show',
path: 'workflow/protected_branches/protected_branches1',
format: 'png')
path = '/help/shortcuts'
expect(get(path)).to route_to('help#show',
path: 'shortcuts')
path = '/help/ui'
expect(get(path)).to route_to('help#show',
path: 'ui')
expect(get(path)).to route_to('help#ui')
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