From 099c8a6608c5ccbffa2706af901f161c0a8034d4 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sun, 8 May 2011 02:38:36 +0000 Subject: [PATCH] scm: git: add test of diff non ASCII path and non ASCII content in functional test. TODO: this test fails in Ruby 1.9 and Encoding.default_external is not UTF-8. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5698 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../repositories_git_controller_test.rb | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/functional/repositories_git_controller_test.rb b/test/functional/repositories_git_controller_test.rb index c4904f2b7..b0542d6af 100644 --- a/test/functional/repositories_git_controller_test.rb +++ b/test/functional/repositories_git_controller_test.rb @@ -217,6 +217,34 @@ class RepositoriesGitControllerTest < ActionController::TestCase assert_tag :tag => 'h2', :content => /2f9c0091:61b685fb/ end + def test_diff_latin_1 + if @ruby19_non_utf8_pass + puts_ruby19_non_utf8_pass() + else + with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do + ['57ca437c', '57ca437c0acbbcb749821fdf3726a1367056d364'].each do |r1| + get :diff, :id => PRJ_ID, :rev => r1 + assert_response :success + assert_template 'diff' + assert_tag :tag => 'thead', + :descendant => { + :tag => 'th', + :attributes => { :class => 'filename' } , + :content => /latin-1-dir\/test-#{@char_1}.txt/ , + }, + :sibling => { + :tag => 'tbody', + :descendant => { + :tag => 'td', + :attributes => { :class => /diff_in/ }, + :content => /test-#{@char_1}.txt/ + } + } + end + end + end + end + def test_annotate get :annotate, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb'] assert_response :success -- 2.39.5