summaryrefslogtreecommitdiffstats
path: root/test/functional/settings_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-07-10 21:05:35 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-07-10 21:05:35 +0000
commit60e07b9bb31a11475981576f254c7905273f093e (patch)
treeecd66888fcf25d387d889ebc72bb22ede79b36e0 /test/functional/settings_controller_test.rb
parent48259a1eda50494eea63830d6e747d4b602b7631 (diff)
downloadredmine-60e07b9bb31a11475981576f254c7905273f093e.tar.gz
redmine-60e07b9bb31a11475981576f254c7905273f093e.zip
Don't error when posting empty plugin settings (#26393).
git-svn-id: http://svn.redmine.org/redmine/trunk@16812 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/settings_controller_test.rb')
-rw-r--r--test/functional/settings_controller_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/settings_controller_test.rb b/test/functional/settings_controller_test.rb
index c506978c0..4c1019191 100644
--- a/test/functional/settings_controller_test.rb
+++ b/test/functional/settings_controller_test.rb
@@ -242,6 +242,20 @@ class SettingsControllerTest < Redmine::ControllerTest
assert_equal({'sample_setting' => 'Value'}, Setting.plugin_foo)
end
+ def test_post_empty_plugin_settings
+ Redmine::Plugin.register(:foo) do
+ settings :partial => 'not blank', # so that configurable? is true
+ :default => {'sample_setting' => 'Plugin setting value'}
+ end
+
+ post :plugin, :params => {
+ :id => 'foo'
+ }
+ assert_redirected_to '/settings/plugin/foo'
+
+ assert_equal({}, Setting.plugin_foo)
+ end
+
def test_post_non_configurable_plugin_settings
Redmine::Plugin.register(:foo) {}