diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-02-27 13:49:37 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-02-27 13:49:37 +0000 |
commit | 186a64c557a407c7688c964d6bbe8e543166002d (patch) | |
tree | a6316046861ac2bc2f5c1cd74326d1160c5514dd /test/unit/repository_git_test.rb | |
parent | 5f44bf1e7a5e998f7bf96c5a3ecf93a1cfc30940 (diff) | |
download | redmine-186a64c557a407c7688c964d6bbe8e543166002d.tar.gz redmine-186a64c557a407c7688c964d6bbe8e543166002d.zip |
scm: git: add utf-8 log test in app unit test (#3396).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4956 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/repository_git_test.rb')
-rw-r--r-- | test/unit/repository_git_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/repository_git_test.rb b/test/unit/repository_git_test.rb index 407250c16..46d1ad6bb 100644 --- a/test/unit/repository_git_test.rb +++ b/test/unit/repository_git_test.rb @@ -24,7 +24,10 @@ class RepositoryGitTest < ActiveSupport::TestCase REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/git_repository' REPOSITORY_PATH.gsub!(/\//, "\\") if Redmine::Platform.mswin? + FELIX_HEX = "Felix Sch\xC3\xA4fer" + def setup + Setting.commit_logs_encoding = 'UTF-8' @project = Project.find(3) @repository = Repository::Git.create(:project => @project, :url => REPOSITORY_PATH) assert @repository @@ -104,6 +107,17 @@ class RepositoryGitTest < ActiveSupport::TestCase assert c.event_title.include?('abc7234c:') assert_equal 'abc7234cb2750b63f47bff735edc50a1c0a433c2', c.event_url[:rev] end + + def test_log_utf8 + @repository.fetch_changesets + @repository.reload + str_felix_hex = FELIX_HEX + if str_felix_hex.respond_to?(:force_encoding) + str_felix_hex.force_encoding('UTF-8') + end + c = @repository.changesets.find_by_revision('ed5bb786bbda2dee66a2d50faf51429dbc043a7b') + assert_equal "#{str_felix_hex} <felix@fachschaften.org>", c.committer + end else puts "Git test repository NOT FOUND. Skipping unit tests !!!" def test_fake; assert true end |