diff options
Diffstat (limited to 'test/functional/timelog_report_test.rb')
-rw-r--r-- | test/functional/timelog_report_test.rb | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/test/functional/timelog_report_test.rb b/test/functional/timelog_report_test.rb index 678265f27..58a0a11a5 100644 --- a/test/functional/timelog_report_test.rb +++ b/test/functional/timelog_report_test.rb @@ -260,10 +260,9 @@ class TimelogReportTest < Redmine::ControllerTest end def test_csv_big_5 - str_utf8 = "\xe4\xb8\x80\xe6\x9c\x88".force_encoding('UTF-8') - str_big5 = "\xa4@\xa4\xeb".force_encoding('Big5') + str_big5 = (+"\xa4@\xa4\xeb").force_encoding('Big5') user = User.find_by_id(3) - user.firstname = str_utf8 + user.firstname = "一月" user.lastname = "test-lastname" assert user.save comments = "test_csv_big_5" @@ -293,24 +292,22 @@ class TimelogReportTest < Redmine::ControllerTest assert_equal 'text/csv; header=present', @response.content_type lines = @response.body.chomp.split("\n") # Headers - s1 = "\xa5\xce\xa4\xe1,2011-11-11,\xa4u\xae\xc9\xc1`\xadp".force_encoding('Big5') - s2 = "\xa4u\xae\xc9\xc1`\xadp".force_encoding('Big5') + s1 = (+"\xa5\xce\xa4\xe1,2011-11-11,\xa4u\xae\xc9\xc1`\xadp").force_encoding('Big5') + s2 = (+"\xa4u\xae\xc9\xc1`\xadp").force_encoding('Big5') assert_equal s1, lines.first # Total row assert_equal "#{str_big5} #{user.lastname},7.30,7.30", lines[1] assert_equal "#{s2},7.30,7.30", lines[2] - str_tw = "Chinese/Traditional (\xe7\xb9\x81\xe9\xab\x94\xe4\xb8\xad\xe6\x96\x87)".force_encoding('UTF-8') - assert_equal str_tw, l(:general_lang_name) + assert_equal 'Chinese/Traditional (繁體中文)', l(:general_lang_name) assert_equal 'Big5', l(:general_csv_encoding) assert_equal ',', l(:general_csv_separator) assert_equal '.', l(:general_csv_decimal_separator) end def test_csv_cannot_convert_should_be_replaced_big_5 - str_utf8 = "\xe4\xbb\xa5\xe5\x86\x85".force_encoding('UTF-8') user = User.find_by_id(3) - user.firstname = str_utf8 + user.firstname = "以内" user.lastname = "test-lastname" assert user.save comments = "test_replaced" @@ -340,10 +337,10 @@ class TimelogReportTest < Redmine::ControllerTest assert_equal 'text/csv; header=present', @response.content_type lines = @response.body.chomp.split("\n") # Headers - s1 = "\xa5\xce\xa4\xe1,2011-11-11,\xa4u\xae\xc9\xc1`\xadp".force_encoding('Big5') + s1 = (+"\xa5\xce\xa4\xe1,2011-11-11,\xa4u\xae\xc9\xc1`\xadp").force_encoding('Big5') assert_equal s1, lines.first # Total row - s2 = "\xa5H?".force_encoding('Big5') + s2 = (+"\xa5H?").force_encoding('Big5') assert_equal "#{s2} #{user.lastname},7.30,7.30", lines[1] end @@ -375,15 +372,14 @@ class TimelogReportTest < Redmine::ControllerTest assert_equal 'text/csv; header=present', @response.content_type lines = @response.body.chomp.split("\n") # Headers - s1 = "Utilisateur;2011-11-11;Temps total".force_encoding('ISO-8859-1') - s2 = "Temps total".force_encoding('ISO-8859-1') + s1 = (+"Utilisateur;2011-11-11;Temps total").force_encoding('ISO-8859-1') + s2 = (+"Temps total").force_encoding('ISO-8859-1') assert_equal s1, lines.first # Total row assert_equal "#{user.firstname} #{user.lastname};7,30;7,30", lines[1] assert_equal "#{s2};7,30;7,30", lines[2] - str_fr = "French (Fran\xc3\xa7ais)".force_encoding('UTF-8') - assert_equal str_fr, l(:general_lang_name) + assert_equal 'French (Français)', l(:general_lang_name) assert_equal 'ISO-8859-1', l(:general_csv_encoding) assert_equal ';', l(:general_csv_separator) assert_equal ',', l(:general_csv_decimal_separator) |