Strip non utf8 content when displaying diff (ruby1.9 compatibility).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4604 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2011-01-01 13:40:36 +00:00
parent 1c7079db3f
commit 488285e123
6 changed files with 65 additions and 11 deletions
+26 -3
View File
@@ -1,5 +1,7 @@
# redMine - project management software
# Copyright (C) 2006-2008 Jean-Philippe Lang
# encoding: utf-8
#
# Redmine - project management software
# Copyright (C) 2006-2011 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -35,10 +37,31 @@ class AttachmentsControllerTest < ActionController::TestCase
end
def test_show_diff
get :show, :id => 5
get :show, :id => 14 # 060719210727_changeset_utf8.diff
assert_response :success
assert_template 'diff'
assert_equal 'text/html', @response.content_type
assert_tag 'th',
:attributes => {:class => /filename/},
:content => /issues_controller.rb\t\(révision 1484\)/
assert_tag 'td',
:attributes => {:class => /line-code/},
:content => /Demande créée avec succès/
end
def test_show_diff_should_strip_non_utf8_content
get :show, :id => 5 # 060719210727_changeset_iso8859-1.diff
assert_response :success
assert_template 'diff'
assert_equal 'text/html', @response.content_type
assert_tag 'th',
:attributes => {:class => /filename/},
:content => /issues_controller.rb\t\(rvision 1484\)/
assert_tag 'td',
:attributes => {:class => /line-code/},
:content => /Demande cre avec succs/
end
def test_show_text_file