@@ -122,16 +122,20 module QueriesHelper | |||
|
122 | 122 | end |
|
123 | 123 | end |
|
124 | 124 | |
|
125 |
def csv_value(column, |
|
|
125 | def csv_value(column, object, value) | |
|
126 | 126 | format_object(value, false) do |value| |
|
127 | 127 | case value.class.name |
|
128 | 128 | when 'Float' |
|
129 | 129 | sprintf("%.2f", value).gsub('.', l(:general_csv_decimal_separator)) |
|
130 | 130 | when 'IssueRelation' |
|
131 |
other = value.other_issue( |
|
|
132 |
l(value.label_for( |
|
|
131 | other = value.other_issue(object) | |
|
132 | l(value.label_for(object)) + " ##{other.id}" | |
|
133 | 133 | when 'Issue' |
|
134 | value.id | |
|
134 | if object.is_a?(TimeEntry) | |
|
135 | "#{value.tracker} ##{value.id}: #{value.subject}" | |
|
136 | else | |
|
137 | value.id | |
|
138 | end | |
|
135 | 139 | else |
|
136 | 140 | value |
|
137 | 141 | end |
@@ -714,4 +714,14 class TimelogControllerTest < ActionController::TestCase | |||
|
714 | 714 | assert_response :success |
|
715 | 715 | assert_equal 'text/csv; header=present', response.content_type |
|
716 | 716 | end |
|
717 | ||
|
718 | def test_index_csv_should_fill_issue_column_with_tracker_id_and_subject | |
|
719 | issue = Issue.find(1) | |
|
720 | entry = TimeEntry.generate!(:issue => issue, :comments => "Issue column content test") | |
|
721 | ||
|
722 | get :index, :format => 'csv' | |
|
723 | line = response.body.split("\n").detect {|l| l.include?(entry.comments)} | |
|
724 | assert_not_nil line | |
|
725 | assert_include "#{issue.tracker} #1: #{issue.subject}", line | |
|
726 | end | |
|
717 | 727 | end |
General Comments 0
You need to be logged in to leave comments.
Login now