diff test/unit/setting_test.rb @ 1517:dffacf8a6908 redmine-2.5

Update to Redmine SVN revision 13367 on 2.5-stable branch
author Chris Cannam
date Tue, 09 Sep 2014 09:29:00 +0100
parents e248c7af89ec
children
line wrap: on
line diff
--- a/test/unit/setting_test.rb	Tue Sep 09 09:28:31 2014 +0100
+++ b/test/unit/setting_test.rb	Tue Sep 09 09:29:00 2014 +0100
@@ -41,6 +41,20 @@
     assert_equal "My other title", Setting.find_by_name('app_title').value
   end
 
+  def test_setting_with_int_format_should_accept_numeric_only
+    with_settings :session_timeout => 30 do
+      Setting.session_timeout = 'foo'
+      assert_equal "30", Setting.session_timeout
+      Setting.session_timeout = 40
+      assert_equal "40", Setting.session_timeout
+    end
+  end
+
+  def test_setting_with_invalid_name_should_be_valid
+    setting = Setting.new(:name => "does_not_exist", :value => "should_not_be_allowed")
+    assert !setting.save
+  end
+
   def test_serialized_setting
     Setting.notified_events = ['issue_added', 'issue_updated', 'news_added']
     assert_equal ['issue_added', 'issue_updated', 'news_added'], Setting.notified_events