diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-04-15 14:21:11 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-04-15 14:21:11 +0000 |
commit | 5f8c4e07036605512f4bca0417614e5c5f54ced4 (patch) | |
tree | 2bbd7d2ac3ea65dd32fc72bddf6f7d8ed716414a /test/unit/changeset_test.rb | |
parent | e788ae70155933a011f97e51e41259608e6cf5f8 (diff) | |
download | redmine-5f8c4e07036605512f4bca0417614e5c5f54ced4.tar.gz redmine-5f8c4e07036605512f4bca0417614e5c5f54ced4.zip |
scm: add test of invalid utf8 sequences in committer at unit changeset test.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5470 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/changeset_test.rb')
-rw-r--r-- | test/unit/changeset_test.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/unit/changeset_test.rb b/test/unit/changeset_test.rb index 8e98b0574..f50a664fc 100644 --- a/test/unit/changeset_test.rb +++ b/test/unit/changeset_test.rb @@ -254,8 +254,10 @@ class ChangesetTest < ActiveSupport::TestCase def test_invalid_utf8_sequences_in_comments_should_be_replaced_latin1 proj = Project.find(3) # str = File.read("#{RAILS_ROOT}/test/fixtures/encoding/iso-8859-1.txt") - str = "Texte encod\xe9 en ISO-8859-1." - str.force_encoding("ASCII-8BIT") if str.respond_to?(:force_encoding) + str1 = "Texte encod\xe9 en ISO-8859-1." + str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e" + str1.force_encoding("UTF-8") if str1.respond_to?(:force_encoding) + str2.force_encoding("ASCII-8BIT") if str2.respond_to?(:force_encoding) r = Repository::Bazaar.create!( :project => proj, :url => '/tmp/test/bazaar', @@ -265,9 +267,11 @@ class ChangesetTest < ActiveSupport::TestCase :committed_on => Time.now, :revision => '123', :scmid => '12345', - :comments => str) + :comments => str1, + :committer => str2) assert( c.save ) assert_equal "Texte encod? en ISO-8859-1.", c.comments + assert_equal "?a?b?c?d?e", c.committer end def test_invalid_utf8_sequences_in_comments_should_be_replaced_ja_jis |