From a37740d030fe848490e74e95af5ff0d3bcb4a8e1 Mon Sep 17 00:00:00 2001 From: Kevin Fischer Date: Mon, 2 Mar 2020 11:43:11 +0900 Subject: Add test --- test/functional/timelog_report_test.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/functional/timelog_report_test.rb b/test/functional/timelog_report_test.rb index e9c13b311..0c7f56f8c 100644 --- a/test/functional/timelog_report_test.rb +++ b/test/functional/timelog_report_test.rb @@ -259,6 +259,27 @@ class TimelogReportTest < Redmine::ControllerTest assert_equal 'Total time,"","",154.25,8.65,162.90', lines.last end + def test_report_csv_issue_format + get :report, :params => { + :project_id => 1, + :columns => 'month', + :from => "2007-01-01", + :to => "2007-06-30", + :criteria => ["issue"], + :format => "csv" + } + assert_response :success + assert_equal 'text/csv', @response.media_type + lines = @response.body.chomp.split("\n") + assert_equal @response.body, <<~CSV + Issue,2007-3,2007-4,Total time + Bug #1: Cannot print recipes,154.25,\"\",154.25 + Bug #3: Error 281 when updating a recipe,"",1.00,1.00 + [none],\"\",7.65,7.65 + Total time,154.25,8.65,162.90 + CSV + end + def test_csv_big_5 str_big5 = (+"\xa4@\xa4\xeb").force_encoding('Big5') user = User.find_by_id(3) -- 2.21.1 (Apple Git-122.3) From 6f6d8c9b76b8810d2fa992c3a95714248a4fa553 Mon Sep 17 00:00:00 2001 From: Kevin Fischer Date: Mon, 2 Mar 2020 11:43:37 +0900 Subject: Improve issue text rendering --- app/helpers/application_helper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b96165695..427265194 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -251,7 +251,11 @@ module ApplicationHelper when 'FalseClass' l(:general_text_No) when 'Issue' - object.visible? && html ? link_to_issue(object) : "##{object.id}" + return "##{object.id}" unless object.visible? + + return link_to_issue(object) if html + + "#{object.tracker} ##{object.id}: #{object.subject}" when 'Attachment' if html content_tag( -- 2.21.1 (Apple Git-122.3)