Dynamic generation of supported code highlighting languages in help section (#40681).

Patch by Go MAEDA (@maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@22840 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2024-05-19 05:07:42 +00:00
parent d584e7248c
commit c0af36b12d
3 changed files with 18 additions and 880 deletions

View File

@@ -87,5 +87,13 @@ class HelpControllerTest < Redmine::ControllerTest
assert_response :success
assert_select 'h1', :text => "List of languages supported by Redmine code highlighter"
# 1-based index + 1 for the header row
index = Rouge::Lexer.all.sort_by(&:tag).index(Rouge::Lexers::Ruby) + 2
assert_select "table tr:nth-of-type(#{index})" do
assert_select '>td:nth-of-type(1)', :text => 'ruby'
assert_select '>td:nth-of-type(2)', :text => /The Ruby programming language/
assert_select '>td:nth-of-type(2)', :text => /\[aliases: rb\]/
end
end
end