@@ -300,12 +300,16 module Redmine | |||
|
300 | 300 | |
|
301 | 301 | def formatted_value(view, custom_field, value, customized=nil, html=false) |
|
302 | 302 | if html |
|
303 | if value.present? | |
|
303 | 304 | if custom_field.text_formatting == 'full' |
|
304 | 305 | view.textilizable(value, :object => customized) |
|
305 | 306 | else |
|
306 | 307 | view.simple_format(html_escape(value)) |
|
307 | 308 | end |
|
308 | 309 | else |
|
310 | '' | |
|
311 | end | |
|
312 | else | |
|
309 | 313 | value.to_s |
|
310 | 314 | end |
|
311 | 315 | end |
@@ -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