comparison test/unit/setting_test.rb @ 1464:261b3d9a4903 redmine-2.4

Update to Redmine 2.4 branch rev 12663
author Chris Cannam
date Tue, 14 Jan 2014 14:37:42 +0000
parents 433d4f72a19b
children e248c7af89ec
comparison
equal deleted inserted replaced
1296:038ba2d95de8 1464:261b3d9a4903
1 # Redmine - project management software 1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang 2 # Copyright (C) 2006-2013 Jean-Philippe Lang
3 # 3 #
4 # This program is free software; you can redistribute it and/or 4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License 5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2 6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version. 7 # of the License, or (at your option) any later version.
44 def test_serialized_setting 44 def test_serialized_setting
45 Setting.notified_events = ['issue_added', 'issue_updated', 'news_added'] 45 Setting.notified_events = ['issue_added', 'issue_updated', 'news_added']
46 assert_equal ['issue_added', 'issue_updated', 'news_added'], Setting.notified_events 46 assert_equal ['issue_added', 'issue_updated', 'news_added'], Setting.notified_events
47 assert_equal ['issue_added', 'issue_updated', 'news_added'], Setting.find_by_name('notified_events').value 47 assert_equal ['issue_added', 'issue_updated', 'news_added'], Setting.find_by_name('notified_events').value
48 end 48 end
49 49
50 def test_setting_should_be_reloaded_after_clear_cache 50 def test_setting_should_be_reloaded_after_clear_cache
51 Setting.app_title = "My title" 51 Setting.app_title = "My title"
52 assert_equal "My title", Setting.app_title 52 assert_equal "My title", Setting.app_title
53 53
54 s = Setting.find_by_name("app_title") 54 s = Setting.find_by_name("app_title")
55 s.value = 'New title' 55 s.value = 'New title'
56 s.save! 56 s.save!
57 assert_equal "My title", Setting.app_title 57 assert_equal "My title", Setting.app_title
58 58
59 Setting.clear_cache 59 Setting.clear_cache
60 assert_equal "New title", Setting.app_title 60 assert_equal "New title", Setting.app_title
61 end 61 end
62 62
63 def test_per_page_options_array_should_be_an_empty_array_when_setting_is_blank 63 def test_per_page_options_array_should_be_an_empty_array_when_setting_is_blank