From: Marius Balteanu Date: Sun, 3 Mar 2024 22:24:58 +0000 (+0000) Subject: Fix rubocop warning (#39111, #40137). X-Git-Tag: 6.0.0~388 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=54aa8102406d69a56b8927de8eaa529794c37ad6;p=redmine.git Fix rubocop warning (#39111, #40137). git-svn-id: https://svn.redmine.org/redmine/trunk@22757 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index e6da130e0..f085e18da 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -26,10 +26,10 @@ class HelpController < ApplicationController unless lookup_context.exists?(template) lang = "en" end - render template: "help/wiki_syntax/#{Setting.text_formatting}/#{lang}/wiki_syntax_#{type}#{Setting.text_formatting}", :layout => nil + render template: "help/wiki_syntax/#{Setting.text_formatting}/#{lang}/wiki_syntax_#{type}#{Setting.text_formatting}", layout: nil end def show_code_highlighting - render template: "help/wiki_syntax/code_highlighting_languages", :layout => nil + render template: "help/wiki_syntax/code_highlighting_languages", layout: nil end end diff --git a/config/routes.rb b/config/routes.rb index 02e245b72..d884d62db 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -407,8 +407,8 @@ Rails.application.routes.draw do get 'robots.:format', :to => 'welcome#robots', :constraints => {:format => 'txt'} - get 'help/wiki_syntax/(:type)', :controller => 'help', :action => 'show_wiki_syntax', :constraints => { :type => /detailed/ }, as: 'help_wiki_syntax' - get 'help/code_highlighting', :controller => 'help', :action => 'show_code_highlighting', as: 'help_code_highlighting' + get 'help/wiki_syntax/(:type)', :controller => 'help', :action => 'show_wiki_syntax', :constraints => { :type => /detailed/ }, :as => 'help_wiki_syntax' + get 'help/code_highlighting', :controller => 'help', :action => 'show_code_highlighting', :as => 'help_code_highlighting' Redmine::Plugin.directory.glob("*/config/routes.rb").sort.each do |plugin_routes_path| instance_eval(plugin_routes_path.read, plugin_routes_path.to_s) diff --git a/test/functional/help_controller_test.rb b/test/functional/help_controller_test.rb index c3ac44d71..c988ce7f0 100644 --- a/test/functional/help_controller_test.rb +++ b/test/functional/help_controller_test.rb @@ -29,14 +29,14 @@ class HelpControllerTest < Redmine::ControllerTest :common_mark => "Wiki Syntax Quick Reference (CommonMark Markdown (GitHub Flavored))" } - formatters.each {|formatter, result| + formatters.each do |formatter, result| with_settings :text_formatting => formatter do get :show_wiki_syntax assert_response :success assert_select 'h1', :text => result end - } + end end def test_get_help_wiki_syntax_detailed @@ -46,7 +46,7 @@ class HelpControllerTest < Redmine::ControllerTest :common_mark => "Wiki formatting (CommonMark Markdown (GitHub Flavored))" } - formatters.each {|formatter, result| + formatters.each do |formatter, result| with_settings :text_formatting => formatter do get :show_wiki_syntax, :params => { :type => 'detailed' @@ -55,7 +55,7 @@ class HelpControllerTest < Redmine::ControllerTest assert_response :success assert_select 'h1', :text => result end - } + end end def test_get_help_wiki_syntax_should_return_lang_if_available