Fix RuboCop offences introduced in r22328 (#38707).

git-svn-id: https://svn.redmine.org/redmine/trunk@22330 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2023-10-06 08:18:26 +00:00
parent 2a8131ce73
commit 9ab7d166b2

View File

@@ -17,7 +17,7 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../../test_helper', __FILE__) require File.expand_path('../../test_helper', __dir__)
class RoutingPluginsTest < Redmine::RoutingTest class RoutingPluginsTest < Redmine::RoutingTest
setup do setup do
@@ -27,7 +27,7 @@ class RoutingPluginsTest < Redmine::RoutingTest
"config/routes.rb" => <<~ROUTES_CONTENT, "config/routes.rb" => <<~ROUTES_CONTENT,
resources :plugin_articles, only: %i[index] resources :plugin_articles, only: %i[index]
ROUTES_CONTENT ROUTES_CONTENT
"app/contrtollers/plugin_articles_controller.rb" => <<~CONTROLLER_CONTENT, "app/contrtollers/plugin_articles_controller.rb" => <<~CONTROLLER_CONTENT
class PluginArticlesController < ApplicationController class PluginArticlesController < ApplicationController
def index def index
render plain: "foo PluginArticlesController#index" render plain: "foo PluginArticlesController#index"
@@ -41,7 +41,7 @@ class RoutingPluginsTest < Redmine::RoutingTest
# same path helper name with foo's # same path helper name with foo's
get '/bar_plugin_articles', as: :plugin_articles, to: 'bar_plugin_articles#index' get '/bar_plugin_articles', as: :plugin_articles, to: 'bar_plugin_articles#index'
ROUTES_CONTENT ROUTES_CONTENT
"app/contrtollers/bar_plugin_articles_controller.rb" => <<~CONTROLLER_CONTENT, "app/contrtollers/bar_plugin_articles_controller.rb" => <<~CONTROLLER_CONTENT
class BarPluginArticlesController < ApplicationController class BarPluginArticlesController < ApplicationController
def index def index
render plain: "bar BarPluginArticlesController#index" render plain: "bar BarPluginArticlesController#index"
@@ -71,7 +71,7 @@ class RoutingPluginsTest < Redmine::RoutingTest
def setup_plugin(plugin_name, **relative_path_to_content) def setup_plugin(plugin_name, **relative_path_to_content)
plugin_path = Redmine::Plugin.directory / plugin_name.to_s plugin_path = Redmine::Plugin.directory / plugin_name.to_s
plugin_path.mkpath plugin_path.mkpath
(plugin_path / "init.rb").write(<<~EOS) (plugin_path / "init.rb").write(<<~INITRB)
Redmine::Plugin.register :#{plugin_name} do Redmine::Plugin.register :#{plugin_name} do
name 'Test plugin #{plugin_name}' name 'Test plugin #{plugin_name}'
author 'Author name' author 'Author name'
@@ -82,7 +82,7 @@ class RoutingPluginsTest < Redmine::RoutingTest
Pathname(__dir__).glob("app/**/*.rb").sort.each do |path| Pathname(__dir__).glob("app/**/*.rb").sort.each do |path|
require path require path
end end
EOS INITRB
relative_path_to_content.each do |relative_path, content| relative_path_to_content.each do |relative_path, content|
path = plugin_path / relative_path path = plugin_path / relative_path