Defect #41895 ยป 41895.patch
| app/helpers/queries_helper.rb | ||
|---|---|---|
|
else
|
||
|
format_object(value, html: false) do |value|
|
||
|
case value.class.name
|
||
|
when 'Float'
|
||
|
when 'Float', 'Rational'
|
||
|
sprintf("%.2f", value).gsub('.', l(:general_csv_decimal_separator))
|
||
|
when 'IssueRelation'
|
||
|
value.to_s(object)
|
||
| test/functional/timelog_controller_test.rb | ||
|---|---|---|
|
get :index, :params => {:format => 'csv'}
|
||
|
assert_response :success
|
||
|
assert_equal 'text/csv; header=present', response.media_type
|
||
|
parsed_csv = CSV.parse(response.body)
|
||
|
assert_equal %w[Project Date User Activity Issue Comment Hours], parsed_csv.first
|
||
|
assert_equal(
|
||
|
[
|
||
|
'eCookbook', '03/12/2007', 'Redmine Admin', 'Design',
|
||
|
'Bug #1: Cannot print recipes', '', '150.00'
|
||
|
],
|
||
|
parsed_csv.last
|
||
|
)
|
||
|
end
|
||
|
end
|
||