@@ -254,8 +254,10 class ChangesetTest < ActiveSupport::TestCase | |||||
254 | def test_invalid_utf8_sequences_in_comments_should_be_replaced_latin1 |
|
254 | def test_invalid_utf8_sequences_in_comments_should_be_replaced_latin1 | |
255 | proj = Project.find(3) |
|
255 | proj = Project.find(3) | |
256 | # str = File.read("#{RAILS_ROOT}/test/fixtures/encoding/iso-8859-1.txt") |
|
256 | # str = File.read("#{RAILS_ROOT}/test/fixtures/encoding/iso-8859-1.txt") | |
257 | str = "Texte encod\xe9 en ISO-8859-1." |
|
257 | str1 = "Texte encod\xe9 en ISO-8859-1." | |
258 | str.force_encoding("ASCII-8BIT") if str.respond_to?(:force_encoding) |
|
258 | str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e" | |
|
259 | str1.force_encoding("UTF-8") if str1.respond_to?(:force_encoding) | |||
|
260 | str2.force_encoding("ASCII-8BIT") if str2.respond_to?(:force_encoding) | |||
259 | r = Repository::Bazaar.create!( |
|
261 | r = Repository::Bazaar.create!( | |
260 | :project => proj, |
|
262 | :project => proj, | |
261 | :url => '/tmp/test/bazaar', |
|
263 | :url => '/tmp/test/bazaar', | |
@@ -265,9 +267,11 class ChangesetTest < ActiveSupport::TestCase | |||||
265 | :committed_on => Time.now, |
|
267 | :committed_on => Time.now, | |
266 | :revision => '123', |
|
268 | :revision => '123', | |
267 | :scmid => '12345', |
|
269 | :scmid => '12345', | |
268 |
:comments => str |
|
270 | :comments => str1, | |
|
271 | :committer => str2) | |||
269 | assert( c.save ) |
|
272 | assert( c.save ) | |
270 | assert_equal "Texte encod? en ISO-8859-1.", c.comments |
|
273 | assert_equal "Texte encod? en ISO-8859-1.", c.comments | |
|
274 | assert_equal "?a?b?c?d?e", c.committer | |||
271 | end |
|
275 | end | |
272 |
|
276 | |||
273 | def test_invalid_utf8_sequences_in_comments_should_be_replaced_ja_jis |
|
277 | def test_invalid_utf8_sequences_in_comments_should_be_replaced_ja_jis |
General Comments 0
You need to be logged in to leave comments.
Login now