summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2023-12-17 15:05:47 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2023-12-17 15:05:47 +0000
commite566e60e51a740387261a06fe800fefece750fb1 (patch)
tree5cd940235f90af265d85573518f25a8beebe1bc2 /lib
parent4cc0b8d2ca80f4de3a0217184e9ef982f2407c05 (diff)
downloadredmine-e566e60e51a740387261a06fe800fefece750fb1.tar.gz
redmine-e566e60e51a740387261a06fe800fefece750fb1.zip
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
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/plugin_loader.rb2
-rw-r--r--lib/tasks/testing.rake7
2 files changed, 8 insertions, 1 deletions
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