annotate test/unit/lib/redmine/themes_test.rb @ 1474:c4436fec34bf bug_494

Close obsolete branch bug_494
author Chris Cannam
date Sat, 10 Nov 2012 13:57:53 +0000
parents cbb26bc654de
children 433d4f72a19b
rev   line source
Chris@119 1 # Redmine - project management software
Chris@909 2 # Copyright (C) 2006-2011 Jean-Philippe Lang
Chris@119 3 #
Chris@119 4 # This program is free software; you can redistribute it and/or
Chris@119 5 # modify it under the terms of the GNU General Public License
Chris@119 6 # as published by the Free Software Foundation; either version 2
Chris@119 7 # of the License, or (at your option) any later version.
Chris@909 8 #
Chris@119 9 # This program is distributed in the hope that it will be useful,
Chris@119 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@119 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@119 12 # GNU General Public License for more details.
Chris@909 13 #
Chris@119 14 # You should have received a copy of the GNU General Public License
Chris@119 15 # along with this program; if not, write to the Free Software
Chris@119 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Chris@119 17
Chris@119 18 require File.expand_path('../../../../test_helper', __FILE__)
Chris@119 19
Chris@119 20 class Redmine::ThemesTest < ActiveSupport::TestCase
Chris@909 21
Chris@119 22 def test_themes
Chris@119 23 themes = Redmine::Themes.themes
Chris@119 24 assert_kind_of Array, themes
Chris@119 25 assert_kind_of Redmine::Themes::Theme, themes.first
Chris@119 26 end
Chris@909 27
Chris@119 28 def test_rescan
Chris@119 29 Redmine::Themes.themes.pop
Chris@909 30
Chris@119 31 assert_difference 'Redmine::Themes.themes.size' do
Chris@119 32 Redmine::Themes.rescan
Chris@119 33 end
Chris@119 34 end
Chris@909 35
Chris@119 36 def test_theme_loaded
Chris@119 37 theme = Redmine::Themes.themes.last
Chris@909 38
Chris@119 39 assert_equal theme, Redmine::Themes.theme(theme.id)
Chris@119 40 end
Chris@909 41
Chris@119 42 def test_theme_loaded_without_rescan
Chris@119 43 theme = Redmine::Themes.themes.last
Chris@909 44
Chris@119 45 assert_equal theme, Redmine::Themes.theme(theme.id, :rescan => false)
Chris@119 46 end
Chris@909 47
Chris@119 48 def test_theme_not_loaded
Chris@119 49 theme = Redmine::Themes.themes.pop
Chris@909 50
Chris@119 51 assert_equal theme, Redmine::Themes.theme(theme.id)
Chris@119 52 end
Chris@909 53
Chris@119 54 def test_theme_not_loaded_without_rescan
Chris@119 55 theme = Redmine::Themes.themes.pop
Chris@909 56
Chris@119 57 assert_nil Redmine::Themes.theme(theme.id, :rescan => false)
Chris@119 58 end
Chris@119 59 end