diff options
author | Go MAEDA <maeda@farend.jp> | 2024-05-19 05:07:42 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2024-05-19 05:07:42 +0000 |
commit | c0af36b12da1d053d87735c174e7c79e97254e75 (patch) | |
tree | 870edab5c83d7480d8e03341a38d5a2c7f9b59fb /test | |
parent | d584e7248c865b4b93a674bc360478768b620f2c (diff) | |
download | redmine-c0af36b12da1d053d87735c174e7c79e97254e75.tar.gz redmine-c0af36b12da1d053d87735c174e7c79e97254e75.zip |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/help_controller_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/help_controller_test.rb b/test/functional/help_controller_test.rb index c988ce7f0..153a6d518 100644 --- a/test/functional/help_controller_test.rb +++ b/test/functional/help_controller_test.rb @@ -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 |