Mercurial > hg > soundsoftware-site
comparison 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 |
comparison
equal
deleted
inserted
replaced
1516:b450a9d58aed | 1517:dffacf8a6908 |
---|---|
37 | 37 |
38 Setting.app_title = "My other title" | 38 Setting.app_title = "My other title" |
39 assert_equal "My other title", Setting.app_title | 39 assert_equal "My other title", Setting.app_title |
40 # make sure db has been updated (UPDATE) | 40 # make sure db has been updated (UPDATE) |
41 assert_equal "My other title", Setting.find_by_name('app_title').value | 41 assert_equal "My other title", Setting.find_by_name('app_title').value |
42 end | |
43 | |
44 def test_setting_with_int_format_should_accept_numeric_only | |
45 with_settings :session_timeout => 30 do | |
46 Setting.session_timeout = 'foo' | |
47 assert_equal "30", Setting.session_timeout | |
48 Setting.session_timeout = 40 | |
49 assert_equal "40", Setting.session_timeout | |
50 end | |
51 end | |
52 | |
53 def test_setting_with_invalid_name_should_be_valid | |
54 setting = Setting.new(:name => "does_not_exist", :value => "should_not_be_allowed") | |
55 assert !setting.save | |
42 end | 56 end |
43 | 57 |
44 def test_serialized_setting | 58 def test_serialized_setting |
45 Setting.notified_events = ['issue_added', 'issue_updated', 'news_added'] | 59 Setting.notified_events = ['issue_added', 'issue_updated', 'news_added'] |
46 assert_equal ['issue_added', 'issue_updated', 'news_added'], Setting.notified_events | 60 assert_equal ['issue_added', 'issue_updated', 'news_added'], Setting.notified_events |