2007-02-02 17:47:13 +03:00
|
|
|
# redMine - project management software
|
|
|
|
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
2010-12-13 02:24:34 +03:00
|
|
|
require File.expand_path('../../test_helper', __FILE__)
|
2009-09-13 21:14:35 +04:00
|
|
|
require 'application_controller'
|
2007-02-02 17:47:13 +03:00
|
|
|
|
|
|
|
# Re-raise errors caught by the controller.
|
|
|
|
class ApplicationController; def rescue_action(e) raise e end; end
|
|
|
|
|
2009-09-13 21:14:35 +04:00
|
|
|
class ApplicationControllerTest < ActionController::TestCase
|
2009-02-21 14:04:50 +03:00
|
|
|
include Redmine::I18n
|
|
|
|
|
2007-02-02 17:47:13 +03:00
|
|
|
def setup
|
|
|
|
@controller = ApplicationController.new
|
|
|
|
@request = ActionController::TestRequest.new
|
|
|
|
@response = ActionController::TestResponse.new
|
|
|
|
end
|
|
|
|
|
2007-05-24 21:29:11 +04:00
|
|
|
# check that all language files are valid
|
2007-02-02 17:47:13 +03:00
|
|
|
def test_localization
|
2009-02-21 14:04:50 +03:00
|
|
|
lang_files_count = Dir["#{RAILS_ROOT}/config/locales/*.yml"].size
|
|
|
|
assert_equal lang_files_count, valid_languages.size
|
|
|
|
valid_languages.each do |lang|
|
2007-02-02 17:47:13 +03:00
|
|
|
assert set_language_if_valid(lang)
|
|
|
|
end
|
2008-02-16 21:09:26 +03:00
|
|
|
set_language_if_valid('en')
|
2007-02-02 17:47:13 +03:00
|
|
|
end
|
2008-11-06 08:37:29 +03:00
|
|
|
|
|
|
|
def test_call_hook_mixed_in
|
|
|
|
assert @controller.respond_to?(:call_hook)
|
|
|
|
end
|
2007-02-02 17:47:13 +03:00
|
|
|
end
|