@@ -300,10 +300,14 module Redmine | |||
|
300 | 300 | |
|
301 | 301 | def formatted_value(view, custom_field, value, customized=nil, html=false) |
|
302 | 302 | if html |
|
303 | if custom_field.text_formatting == 'full' | |
|
304 | view.textilizable(value, :object => customized) | |
|
303 | if value.present? | |
|
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 | 309 | else |
|
306 | view.simple_format(html_escape(value)) | |
|
310 | '' | |
|
307 | 311 | end |
|
308 | 312 | else |
|
309 | 313 | value.to_s |
@@ -363,6 +363,15 class ProjectsControllerTest < ActionController::TestCase | |||
|
363 | 363 | assert_select 'li', :text => /#{f2.name}/ |
|
364 | 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 | 375 | def test_show_should_not_fail_when_custom_values_are_nil |
|
367 | 376 | project = Project.find_by_identifier('ecookbook') |
|
368 | 377 | project.custom_values.first.update_attribute(:value, nil) |
General Comments 0
You need to be logged in to leave comments.
Login now