@@ -327,32 +327,32 class ChangesetTest < ActiveSupport::TestCase | |||||
327 | end |
|
327 | end | |
328 |
|
328 | |||
329 | def test_invalid_utf8_sequences_in_paths_should_be_replaced |
|
329 | def test_invalid_utf8_sequences_in_paths_should_be_replaced | |
330 |
|
|
330 | proj = Project.find(3) | |
331 |
|
|
331 | str1 = "Texte encod\xe9 en ISO-8859-1" | |
332 |
|
|
332 | str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test" | |
333 |
|
|
333 | str1.force_encoding("UTF-8") if str1.respond_to?(:force_encoding) | |
334 |
|
|
334 | str2.force_encoding("ASCII-8BIT") if str2.respond_to?(:force_encoding) | |
335 |
|
|
335 | r = Repository::Bazaar.create!( | |
336 | :project => proj, |
|
336 | :project => proj, | |
337 | :url => '/tmp/test/bazaar', |
|
337 | :url => '/tmp/test/bazaar', | |
338 | :log_encoding => 'UTF-8' ) |
|
338 | :log_encoding => 'UTF-8' ) | |
339 |
|
|
339 | assert r | |
340 |
|
|
340 | cs = Changeset.new( | |
341 | :repository => r, |
|
341 | :repository => r, | |
342 | :committed_on => Time.now, |
|
342 | :committed_on => Time.now, | |
343 | :revision => '123', |
|
343 | :revision => '123', | |
344 | :scmid => '12345', |
|
344 | :scmid => '12345', | |
345 | :comments => "test") |
|
345 | :comments => "test") | |
346 |
|
|
346 | assert(cs.save) | |
347 |
|
|
347 | ch = Change.new( | |
348 | :changeset => cs, |
|
348 | :changeset => cs, | |
349 | :action => "A", |
|
349 | :action => "A", | |
350 | :path => str1, |
|
350 | :path => str1, | |
351 | :from_path => str2, |
|
351 | :from_path => str2, | |
352 | :from_revision => "345") |
|
352 | :from_revision => "345") | |
353 |
|
|
353 | assert(ch.save) | |
354 |
|
|
354 | assert_equal "Texte encod? en ISO-8859-1", ch.path | |
355 |
|
|
355 | assert_equal "?a?b?c?d?e test", ch.from_path | |
356 | end |
|
356 | end | |
357 |
|
357 | |||
358 | def test_comments_nil |
|
358 | def test_comments_nil |
General Comments 0
You need to be logged in to leave comments.
Login now