summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/autoload/plugin_autoload_test.rb27
-rw-r--r--test/fixtures/plugins/foo_plugin/app/models/foo.rb3
2 files changed, 30 insertions, 0 deletions
diff --git a/test/autoload/plugin_autoload_test.rb b/test/autoload/plugin_autoload_test.rb
new file mode 100644
index 000000000..76a1983d2
--- /dev/null
+++ b/test/autoload/plugin_autoload_test.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+# Redmine - project management software
+# Copyright (C) 2006-2023 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+require_relative '../test_helper'
+class Redmine::PluginAutoloadTest < ActiveSupport::TestCase
+ if ENV['REDMINE_PLUGINS_DIRECTORY']
+ def test_autoload
+ assert_equal true, Object.const_defined?(:Foo)
+ end
+ else
+ puts 'Tests related to plugin autoloading should be run separately using "rails test:autoload"'
+ end
+end
diff --git a/test/fixtures/plugins/foo_plugin/app/models/foo.rb b/test/fixtures/plugins/foo_plugin/app/models/foo.rb
new file mode 100644
index 000000000..0152b6e1a
--- /dev/null
+++ b/test/fixtures/plugins/foo_plugin/app/models/foo.rb
@@ -0,0 +1,3 @@
+# frozen_string_literal: true
+class Foo < ActiveRecord::Base
+end