From c0af36b12da1d053d87735c174e7c79e97254e75 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 19 May 2024 05:07:42 +0000 Subject: 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 --- test/functional/help_controller_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') 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 -- cgit v1.2.3