diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2021-11-25 21:34:40 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2021-11-25 21:34:40 +0000 |
commit | 79e7cde849ffa6b4f7a6e37eb9b5893a05d481ca (patch) | |
tree | 1cf0d8cf90687ebcdaaa1cab65f804fc0547c4a8 /test/unit/lib | |
parent | 5865edeba731bdb5a0e5bff17c6ec3ba08d941e7 (diff) | |
download | redmine-79e7cde849ffa6b4f7a6e37eb9b5893a05d481ca.tar.gz redmine-79e7cde849ffa6b4f7a6e37eb9b5893a05d481ca.zip |
Fix plugin assets are no longer copied under plugin name (#36218, #29914, #32938).
git-svn-id: http://svn.redmine.org/redmine/trunk@21295 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/lib')
-rw-r--r-- | test/unit/lib/redmine/plugin_loader_test.rb | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/plugin_loader_test.rb b/test/unit/lib/redmine/plugin_loader_test.rb new file mode 100644 index 000000000..43d100521 --- /dev/null +++ b/test/unit/lib/redmine/plugin_loader_test.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Redmine - project management software +# Copyright (C) 2006-2021 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 File.expand_path('../../../../test_helper', __FILE__) + +class Redmine::PluginLoaderTest < ActiveSupport::TestCase + def setup + clear_public + + @klass = Redmine::PluginLoader + @klass.directory = Rails.root.join('test/fixtures/plugins') + @klass.public_directory = Rails.root.join('tmp/public/plugin_assets') + @klass.load + end + + def teardown + clear_public + end + + def test_create_assets_reloader + plugin_assets = @klass.create_assets_reloader + plugin_assets.execute.inspect + + assert File.exist?("#{@klass.public_directory}/foo_plugin") + assert File.exist?("#{@klass.public_directory}/foo_plugin/stylesheets/foo.css") + end + + def clear_public + FileUtils.rm_rf 'tmp/public' + end +end |