diff options
author | Go MAEDA <maeda@farend.jp> | 2022-07-21 00:41:29 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2022-07-21 00:41:29 +0000 |
commit | 7752e9a19abf14c44f28ac3eca28e496dbcca4f9 (patch) | |
tree | f3dd2f1af41a1f688877546ed22f9bb11e675e5e /test/unit/lib/redmine/plugin_test.rb | |
parent | b6c218deed9fcb9b4081e0a98f081ecf2558cb20 (diff) | |
download | redmine-7752e9a19abf14c44f28ac3eca28e496dbcca4f9.tar.gz redmine-7752e9a19abf14c44f28ac3eca28e496dbcca4f9.zip |
Psych::DisallowedClass exception when loading default plugin settings (#37450, #37476).
Contributed by Dmitry Makurin.
git-svn-id: https://svn.redmine.org/redmine/trunk@21725 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/lib/redmine/plugin_test.rb')
-rw-r--r-- | test/unit/lib/redmine/plugin_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/plugin_test.rb b/test/unit/lib/redmine/plugin_test.rb index 54394ab57..a5a1b2aa3 100644 --- a/test/unit/lib/redmine/plugin_test.rb +++ b/test/unit/lib/redmine/plugin_test.rb @@ -196,6 +196,13 @@ class Redmine::PluginTest < ActiveSupport::TestCase end end + def test_default_settings + @klass.register(:foo_plugin) {settings :default => {'key1' => 'abc', :key2 => 123}} + h = Setting.plugin_foo_plugin + assert_equal 'abc', h['key1'] + assert_equal 123, h[:key2] + end + def test_settings_warns_about_possible_partial_collision @klass.register(:foo_plugin) {settings :partial => 'foo/settings'} Rails.logger.expects(:warn) |