Project

General

Profile

Defect #27543 » 27543-remove-inherited-limitation-with-test-2.patch

Takenori TAKAKI, 2024-02-09 08:27

View differences:

lib/redmine/field_format.rb
end
class EnumerationFormat < RecordList
self.customized_class_names = nil
add 'enumeration'
self.form_partial = 'custom_fields/formats/enumeration'
test/unit/lib/redmine/field_format/enumeration_format_test.rb
assert_equal [@foo.id], @field.value_from_keyword('foo, baz', nil)
assert_equal [], @field.value_from_keyword('baz', nil)
end
def test_customized_class_names_should_overrided_to_nil
assert_nil Redmine::FieldFormat::EnumerationFormat.customized_class_names
end
end
test/unit/lib/redmine/field_format/field_format_test.rb
assert_equal "foo bar", field.format.formatted_custom_value(self, custom_value, false)
assert_equal '<a href="http://foo/foo%20bar#anchor" class="external">foo bar</a>', field.format.formatted_custom_value(self, custom_value, true)
end
def test_as_select_should_return_enumeration_for_all_classes
%w(Issue TimeEntry Project Version Document User Group TimeEntryActivity IssuePriority DocumentCategory).each do |klass|
assert_include ['Key/value list', 'enumeration'], Redmine::FieldFormat.as_select(klass)
end
end
end
(2-2/2)