Defect #33052 » 0001-33052-fix-issue-text-format.patch
| test/functional/timelog_report_test.rb | ||
|---|---|---|
| 259 | 259 |
assert_equal 'Total time,"","",154.25,8.65,162.90', lines.last |
| 260 | 260 |
end |
| 261 | 261 | |
| 262 |
def test_report_csv_issue_format |
|
| 263 |
get :report, :params => {
|
|
| 264 |
:project_id => 1, |
|
| 265 |
:columns => 'month', |
|
| 266 |
:from => "2007-01-01", |
|
| 267 |
:to => "2007-06-30", |
|
| 268 |
:criteria => ["issue"], |
|
| 269 |
:format => "csv" |
|
| 270 |
} |
|
| 271 |
assert_response :success |
|
| 272 |
assert_equal 'text/csv', @response.media_type |
|
| 273 |
lines = @response.body.chomp.split("\n")
|
|
| 274 |
assert_equal @response.body, <<~CSV |
|
| 275 |
Issue,2007-3,2007-4,Total time |
|
| 276 |
Bug #1: Cannot print recipes,154.25,\"\",154.25 |
|
| 277 |
Bug #3: Error 281 when updating a recipe,"",1.00,1.00 |
|
| 278 |
[none],\"\",7.65,7.65 |
|
| 279 |
Total time,154.25,8.65,162.90 |
|
| 280 |
CSV |
|
| 281 |
end |
|
| 282 | ||
| 262 | 283 |
def test_csv_big_5 |
| 263 | 284 |
str_big5 = (+"\xa4@\xa4\xeb").force_encoding('Big5')
|
| 264 | 285 |
user = User.find_by_id(3) |
| 265 |
- |
|
| app/helpers/application_helper.rb | ||
|---|---|---|
| 251 | 251 |
when 'FalseClass' |
| 252 | 252 |
l(:general_text_No) |
| 253 | 253 |
when 'Issue' |
| 254 |
object.visible? && html ? link_to_issue(object) : "##{object.id}"
|
|
| 254 |
return "##{object.id}" unless object.visible?
|
|
| 255 | ||
| 256 |
return link_to_issue(object) if html |
|
| 257 | ||
| 258 |
"#{object.tracker} ##{object.id}: #{object.subject}"
|
|
| 255 | 259 |
when 'Attachment' |
| 256 | 260 |
if html |
| 257 | 261 |
content_tag( |