@@ -300,10 +300,14 module Redmine | |||||
300 |
|
300 | |||
301 | def formatted_value(view, custom_field, value, customized=nil, html=false) |
|
301 | def formatted_value(view, custom_field, value, customized=nil, html=false) | |
302 | if html |
|
302 | if html | |
303 | if custom_field.text_formatting == 'full' |
|
303 | if value.present? | |
304 | view.textilizable(value, :object => customized) |
|
304 | if custom_field.text_formatting == 'full' | |
|
305 | view.textilizable(value, :object => customized) | |||
|
306 | else | |||
|
307 | view.simple_format(html_escape(value)) | |||
|
308 | end | |||
305 | else |
|
309 | else | |
306 | view.simple_format(html_escape(value)) |
|
310 | '' | |
307 | end |
|
311 | end | |
308 | else |
|
312 | else | |
309 | value.to_s |
|
313 | value.to_s |
@@ -363,6 +363,15 class ProjectsControllerTest < ActionController::TestCase | |||||
363 | assert_select 'li', :text => /#{f2.name}/ |
|
363 | assert_select 'li', :text => /#{f2.name}/ | |
364 | end |
|
364 | end | |
365 |
|
365 | |||
|
366 | def test_show_should_not_display_blank_text_custom_fields | |||
|
367 | f1 = ProjectCustomField.generate! :field_format => 'text' | |||
|
368 | ||||
|
369 | get :show, :id => 1 | |||
|
370 | assert_response :success | |||
|
371 | ||||
|
372 | assert_select 'li', :text => /#{f1.name}/, :count => 0 | |||
|
373 | end | |||
|
374 | ||||
366 | def test_show_should_not_fail_when_custom_values_are_nil |
|
375 | def test_show_should_not_fail_when_custom_values_are_nil | |
367 | project = Project.find_by_identifier('ecookbook') |
|
376 | project = Project.find_by_identifier('ecookbook') | |
368 | project.custom_values.first.update_attribute(:value, nil) |
|
377 | project.custom_values.first.update_attribute(:value, nil) |
General Comments 0
You need to be logged in to leave comments.
Login now