Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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