From e566e60e51a740387261a06fe800fefece750fb1 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Sun, 17 Dec 2023 15:05:47 +0000 Subject: Adds test for plugin autoload issue (#36320, #39834). Patch by @tohosaku. git-svn-id: https://svn.redmine.org/redmine/trunk@22522 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/plugin_loader.rb | 2 +- lib/tasks/testing.rake | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/redmine/plugin_loader.rb b/lib/redmine/plugin_loader.rb index 135df09ba..9f49208d6 100644 --- a/lib/redmine/plugin_loader.rb +++ b/lib/redmine/plugin_loader.rb @@ -84,7 +84,7 @@ module Redmine class PluginLoader # Absolute path to the directory where plugins are located cattr_accessor :directory - self.directory = Rails.root.join('plugins') + self.directory = Rails.root.join Rails.application.config.redmine_plugins_directory # Absolute path to the public directory where plugins assets are copied cattr_accessor :public_directory diff --git a/lib/tasks/testing.rake b/lib/tasks/testing.rake index 5b5cedb46..2d946b355 100644 --- a/lib/tasks/testing.rake +++ b/lib/tasks/testing.rake @@ -114,4 +114,11 @@ namespace :test do Rails::TestUnit::Runner.run_from_rake 'test', FileList['test/integration/routing/*_test.rb'] + FileList['test/integration/api_test/*_routing_test.rb'] end Rake::Task['test:routing'].comment = "Run the routing tests" + + task(:autoload) do |t| + $: << "test" + ENV["REDMINE_PLUGINS_DIRECTORY"] = "test/fixtures/plugins" + Rails::TestUnit::Runner.run_from_rake 'test', FileList['test/autoload/*_test.rb'] + end + Rake::Task['test:autoload'].comment = "Run the plugin autoload tests" end -- cgit v1.2.3