@@ -29,6 +29,18 class CustomFieldsHelperTest < ActionView::TestCase | |||||
29 | assert_equal 'No', format_value('0', CustomField.new(:field_format => 'bool')) |
|
29 | assert_equal 'No', format_value('0', CustomField.new(:field_format => 'bool')) | |
30 | end |
|
30 | end | |
31 |
|
31 | |||
|
32 | def test_label_tag_should_include_description_as_span_title_if_present | |||
|
33 | field = CustomField.new(:field_format => 'string', :description => 'This is the description') | |||
|
34 | tag = custom_field_label_tag('foo', CustomValue.new(:custom_field => field)) | |||
|
35 | assert_select_in tag, 'label span[title=?]', 'This is the description' | |||
|
36 | end | |||
|
37 | ||||
|
38 | def test_label_tag_should_not_include_title_if_description_is_blank | |||
|
39 | field = CustomField.new(:field_format => 'string') | |||
|
40 | tag = custom_field_label_tag('foo', CustomValue.new(:custom_field => field)) | |||
|
41 | assert_select_in tag, 'label span[title]', 0 | |||
|
42 | end | |||
|
43 | ||||
32 | def test_unknow_field_format_should_be_edited_as_string |
|
44 | def test_unknow_field_format_should_be_edited_as_string | |
33 | field = CustomField.new(:field_format => 'foo') |
|
45 | field = CustomField.new(:field_format => 'foo') | |
34 | value = CustomValue.new(:value => 'bar', :custom_field => field) |
|
46 | value = CustomValue.new(:value => 'bar', :custom_field => field) |
General Comments 0
You need to be logged in to leave comments.
Login now