summaryrefslogtreecommitdiffstats
path: root/test/functional/settings_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-20 13:03:55 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-20 13:03:55 +0000
commitbb314029391d42dec6c9e14fddbe5a01ec5d94fc (patch)
treeae6ded8b758aa1f434528a6fb0627a030153fc34 /test/functional/settings_controller_test.rb
parent253197c598fc50370db9672dc73e1d6a074aa7f7 (diff)
downloadredmine-bb314029391d42dec6c9e14fddbe5a01ec5d94fc.tar.gz
redmine-bb314029391d42dec6c9e14fddbe5a01ec5d94fc.zip
Fix 500 error for requests to the settings path for non-configurable plugins (#12911).
Path by Harry Garrood. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11216 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/settings_controller_test.rb')
-rw-r--r--test/functional/settings_controller_test.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/test/functional/settings_controller_test.rb b/test/functional/settings_controller_test.rb
index 5ae5d09fc..df4abd6b7 100644
--- a/test/functional/settings_controller_test.rb
+++ b/test/functional/settings_controller_test.rb
@@ -101,11 +101,31 @@ class SettingsControllerTest < ActionController::TestCase
assert_response 404
end
+ def test_get_non_configurable_plugin_settings
+ Redmine::Plugin.register(:foo) {}
+
+ get :plugin, :id => 'foo'
+ assert_response 404
+
+ Redmine::Plugin.clear
+ end
+
def test_post_plugin_settings
Setting.expects(:plugin_foo=).with({'sample_setting' => 'Value'}).returns(true)
- Redmine::Plugin.register(:foo) {}
+ Redmine::Plugin.register(:foo) do
+ settings :partial => 'not blank' # so that configurable? is true
+ end
post :plugin, :id => 'foo', :settings => {'sample_setting' => 'Value'}
assert_redirected_to '/settings/plugin/foo'
end
+
+ def test_post_non_configurable_plugin_settings
+ Redmine::Plugin.register(:foo) {}
+
+ post :plugin, :id => 'foo', :settings => {'sample_setting' => 'Value'}
+ assert_response 404
+
+ Redmine::Plugin.clear
+ end
end