summaryrefslogtreecommitdiffstats
path: root/test/unit/repository_subversion_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-02-28 12:09:32 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-02-28 12:09:32 +0000
commit06f078a8137a532e638274abc89d5a06654865e1 (patch)
tree3b0b5ed175bb4bd47118ebe266b64eafb74a301a /test/unit/repository_subversion_test.rb
parent7664892b5de638fba5d30577d4e57ef9bd6f0b43 (diff)
downloadredmine-06f078a8137a532e638274abc89d5a06654865e1.tar.gz
redmine-06f078a8137a532e638274abc89d5a06654865e1.zip
scm: ignore log encoding setting in Subversion and Mercurial (#7597).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4962 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/repository_subversion_test.rb')
-rw-r--r--test/unit/repository_subversion_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/repository_subversion_test.rb b/test/unit/repository_subversion_test.rb
index 5e0b07183..158f17c55 100644
--- a/test/unit/repository_subversion_test.rb
+++ b/test/unit/repository_subversion_test.rb
@@ -137,6 +137,28 @@ class RepositorySubversionTest < ActiveSupport::TestCase
assert c.event_title.include?('123456789:')
assert_equal '123456789', c.event_url[:rev]
end
+
+ def test_log_encoding_ignore_setting
+ with_settings :commit_logs_encoding => 'windows-1252' do
+ s1 = "\xC2\x80"
+ s2 = "\xc3\x82\xc2\x80"
+ if s1.respond_to?(:force_encoding)
+ s3 = s1
+ s4 = s2
+ s1.force_encoding('ASCII-8BIT')
+ s2.force_encoding('ASCII-8BIT')
+ s3.force_encoding('ISO-8859-1')
+ s4.force_encoding('UTF-8')
+ assert_equal s3.encode('UTF-8'), s4
+ end
+ c = Changeset.new(:repository => @repository,
+ :comments=>s2,
+ :revision=>'123',
+ :committed_on => Time.now)
+ assert c.save
+ assert_equal s2, c.comments
+ end
+ end
else
puts "Subversion test repository NOT FOUND. Skipping unit tests !!!"
def test_fake; assert true end