##// END OF EJS Templates
pdf: add test to export issue pdf with UTF-8 U+FFFD (#17826)...
Toshi MARUYAMA -
r13014:3cba1e001246
parent child
Show More
@@ -1405,6 +1405,22 class IssuesControllerTest < ActionController::TestCase
1405 assert_not_nil assigns(:issue)
1405 assert_not_nil assigns(:issue)
1406 end
1406 end
1407
1407
1408 def test_export_to_pdf_with_utf8_u_ffdd
1409 # U+FFFD
1410 s = "\xef\xbf\xbd"
1411 s.force_encoding('UTF-8') if s.respond_to?(:force_encoding)
1412 issue = Issue.generate!(:subject => s)
1413 ["en", "zh", "zh-TW", "ja", "ko"].each do |lang|
1414 with_settings :default_language => lang do
1415 get :show, :id => issue.id, :format => 'pdf'
1416 assert_response :success
1417 assert_equal 'application/pdf', @response.content_type
1418 assert @response.body.starts_with?('%PDF')
1419 assert_not_nil assigns(:issue)
1420 end
1421 end
1422 end
1423
1408 def test_show_export_to_pdf_with_ancestors
1424 def test_show_export_to_pdf_with_ancestors
1409 issue = Issue.generate!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => 1)
1425 issue = Issue.generate!(:project_id => 1, :author_id => 2, :tracker_id => 1, :subject => 'child', :parent_issue_id => 1)
1410
1426
General Comments 0
You need to be logged in to leave comments. Login now