diff options
Diffstat (limited to 'test/functional/issues_controller_test.rb')
-rw-r--r-- | test/functional/issues_controller_test.rb | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index e1637d83d..f62816c01 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -772,8 +772,8 @@ class IssuesControllerTest < Redmine::ControllerTest def test_index_csv_big_5 with_settings :default_language => "zh-TW" do - str_utf8 = "\xe4\xb8\x80\xe6\x9c\x88".force_encoding('UTF-8') - str_big5 = "\xa4@\xa4\xeb".force_encoding('Big5') + str_utf8 = '一月' + str_big5 = (+"\xa4@\xa4\xeb").force_encoding('Big5') issue = Issue.generate!(:subject => str_utf8) get :index, :params => { @@ -784,7 +784,7 @@ class IssuesControllerTest < Redmine::ControllerTest assert_equal 'text/csv; header=present', @response.content_type lines = @response.body.chomp.split("\n") header = lines[0] - status = "\xaa\xac\xbaA".force_encoding('Big5') + status = (+"\xaa\xac\xbaA").force_encoding('Big5') assert_include status, header issue_line = lines.find {|l| l =~ /^#{issue.id},/} assert_include str_big5, issue_line @@ -793,7 +793,7 @@ class IssuesControllerTest < Redmine::ControllerTest def test_index_csv_cannot_convert_should_be_replaced_big_5 with_settings :default_language => "zh-TW" do - str_utf8 = "\xe4\xbb\xa5\xe5\x86\x85".force_encoding('UTF-8') + str_utf8 = '以内' issue = Issue.generate!(:subject => str_utf8) get :index, :params => { @@ -807,10 +807,10 @@ class IssuesControllerTest < Redmine::ControllerTest lines = @response.body.chomp.split("\n") header = lines[0] issue_line = lines.find {|l| l =~ /^#{issue.id},/} - s1 = "\xaa\xac\xbaA".force_encoding('Big5') # status + s1 = (+"\xaa\xac\xbaA").force_encoding('Big5') # status assert header.include?(s1) s2 = issue_line.split(",")[2] - s3 = "\xa5H?".force_encoding('Big5') # subject + s3 = (+"\xa5H?").force_encoding('Big5') # subject assert_equal s3, s2 end end @@ -2345,10 +2345,7 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_export_to_pdf_with_utf8_u_fffd - # U+FFFD - s = "\xef\xbf\xbd" - s.force_encoding('UTF-8') if s.respond_to?(:force_encoding) - issue = Issue.generate!(:subject => s) + issue = Issue.generate!(:subject => "�") ["en", "zh", "zh-TW", "ja", "ko"].each do |lang| with_settings :default_language => lang do get :show, :params => { |