summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2023-10-24 20:06:54 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2023-10-24 20:06:54 +0000
commitbfe6121ef3d5bf2d9889ec16eae624e66174d4e0 (patch)
tree4f66326db5be0b48cf2463fd51d541d5139032f8 /test
parent7ba9cb1da6364aba9500ec60bcb25b9ad93e6773 (diff)
downloadredmine-bfe6121ef3d5bf2d9889ec16eae624e66174d4e0.tar.gz
redmine-bfe6121ef3d5bf2d9889ec16eae624e66174d4e0.zip
Fixes a random failing test in @test_plugins@ (integration/routing/plugins_test.rb) by enforcing the plugins path to @tmp/plugins@ (#38707).
git-svn-id: https://svn.redmine.org/redmine/trunk@22373 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/integration/routing/plugins_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/integration/routing/plugins_test.rb b/test/integration/routing/plugins_test.rb
index 74ecfcb98..b330ec654 100644
--- a/test/integration/routing/plugins_test.rb
+++ b/test/integration/routing/plugins_test.rb
@@ -21,6 +21,8 @@ require File.expand_path('../../test_helper', __dir__)
class RoutingPluginsTest < Redmine::RoutingTest
setup do
+ @tmp_plugins_path = Rails.root.join('tmp/test/plugins')
+
@setup_plugin_paths = []
@setup_plugin_paths << setup_plugin(
:redmine_test_plugin_foo,
@@ -49,6 +51,9 @@ class RoutingPluginsTest < Redmine::RoutingTest
end
CONTROLLER_CONTENT
)
+
+ # Change plugin loader's directory for testing
+ Redmine::PluginLoader.directory = @tmp_plugins_path
Redmine::PluginLoader.load
Redmine::PluginLoader.directories.each(&:run_initializer) # to define relative controllers
RedmineApp::Application.instance.routes_reloader.reload!
@@ -69,7 +74,8 @@ class RoutingPluginsTest < Redmine::RoutingTest
private
def setup_plugin(plugin_name, **relative_path_to_content)
- plugin_path = Redmine::Plugin.directory / plugin_name.to_s
+ Redmine::Plugin.directory = @tmp_plugins_path
+ plugin_path = Redmine::Plugin.directory / plugin_name.to_s
plugin_path.mkpath
(plugin_path / "init.rb").write(<<~INITRB)
Redmine::Plugin.register :#{plugin_name} do