diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-12-05 15:00:27 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-12-05 15:00:27 +0000 |
commit | ca71cf380046d74d71e344da0dd85eed9de18f31 (patch) | |
tree | ee780c5c7a15ed41b136cfd7b80537442cbaa12f /test/functional/settings_controller_test.rb | |
parent | c084ef509f114d0d32891fc58d45817e6e11fa4e (diff) | |
download | redmine-ca71cf380046d74d71e344da0dd85eed9de18f31.tar.gz redmine-ca71cf380046d74d71e344da0dd85eed9de18f31.zip |
Adds methods for loading and adding settings.
git-svn-id: http://svn.redmine.org/redmine/trunk@13719 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/settings_controller_test.rb')
-rw-r--r-- | test/functional/settings_controller_test.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/functional/settings_controller_test.rb b/test/functional/settings_controller_test.rb index 615eae47d..f5f6d46ee 100644 --- a/test/functional/settings_controller_test.rb +++ b/test/functional/settings_controller_test.rb @@ -137,10 +137,10 @@ class SettingsControllerTest < ActionController::TestCase end def test_get_plugin_settings - Setting.stubs(:plugin_foo).returns({'sample_setting' => 'Plugin setting value'}) ActionController::Base.append_view_path(File.join(Rails.root, "test/fixtures/plugins")) Redmine::Plugin.register :foo do - settings :partial => "foo_plugin/foo_plugin_settings" + settings :partial => "foo_plugin/foo_plugin_settings", + :default => {'sample_setting' => 'Plugin setting value'} end get :plugin, :id => 'foo' @@ -169,13 +169,15 @@ class SettingsControllerTest < ActionController::TestCase end def test_post_plugin_settings - Setting.expects(:plugin_foo=).with({'sample_setting' => 'Value'}).returns(true) Redmine::Plugin.register(:foo) do - settings :partial => 'not blank' # so that configurable? is true + settings :partial => 'not blank', # so that configurable? is true + :default => {'sample_setting' => 'Plugin setting value'} end post :plugin, :id => 'foo', :settings => {'sample_setting' => 'Value'} assert_redirected_to '/settings/plugin/foo' + + assert_equal({'sample_setting' => 'Value'}, Setting.plugin_foo) end def test_post_non_configurable_plugin_settings |