From: Marius Balteanu Date: Tue, 12 Dec 2023 16:45:43 +0000 (+0000) Subject: Update integration test for plugin routes after r22515 (#36320, #39803). X-Git-Tag: 6.0.0~580 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=88b776df2f9efacfd49466972c0271e2b422bd1c;p=redmine.git Update integration test for plugin routes after r22515 (#36320, #39803). git-svn-id: https://svn.redmine.org/redmine/trunk@22516 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/integration/routing/plugins_test.rb b/test/integration/routing/plugins_test.rb index 53b10cd0a..0124e759f 100644 --- a/test/integration/routing/plugins_test.rb +++ b/test/integration/routing/plugins_test.rb @@ -20,6 +20,25 @@ require File.expand_path('../../test_helper', __dir__) class RoutingPluginsTest < Redmine::RoutingTest + def setup + @original_plugin_dir = Redmine::PluginLoader.directory + + Redmine::Plugin.clear + Redmine::PluginLoader.directory = Rails.root.join('test/fixtures/plugins') + Redmine::Plugin.directory = Rails.root.join('test/fixtures/plugins') + Redmine::PluginLoader.load + Redmine::PluginLoader.directories.each(&:run_initializer) # to define relative controllers + RedmineApp::Application.instance.routes_reloader.reload! + end + + def teardown + Redmine::Plugin.clear + Redmine::PluginLoader.directory = @original_plugin_dir + Redmine::Plugin.directory = @original_plugin_dir + Redmine::PluginLoader.load + RedmineApp::Application.instance.routes_reloader.reload! + end + def test_plugins should_route 'GET /plugin_articles' => 'plugin_articles#index' should_route 'GET /bar_plugin_articles' => 'bar_plugin_articles#index'