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
829 829
    end
830 830

  
831 831
    class EnumerationFormat < RecordList
832
      self.customized_class_names = nil
833

  
832 834
      add 'enumeration'
833 835
      self.form_partial = 'custom_fields/formats/enumeration'
834 836

  
test/unit/lib/redmine/field_format/enumeration_format_test.rb
100 100
    assert_equal [@foo.id], @field.value_from_keyword('foo, baz', nil)
101 101
    assert_equal [], @field.value_from_keyword('baz', nil)
102 102
  end
103

  
104
  def test_customized_class_names_should_overrided_to_nil
105
    assert_nil Redmine::FieldFormat::EnumerationFormat.customized_class_names
106
  end
103 107
end
test/unit/lib/redmine/field_format/field_format_test.rb
113 113
    assert_equal "foo bar", field.format.formatted_custom_value(self, custom_value, false)
114 114
    assert_equal '<a href="http://foo/foo%20bar#anchor" class="external">foo bar</a>', field.format.formatted_custom_value(self, custom_value, true)
115 115
  end
116

  
117
  def test_as_select_should_return_enumeration_for_all_classes
118
    %w(Issue TimeEntry Project Version Document User Group TimeEntryActivity IssuePriority DocumentCategory).each do |klass|
119
      assert_include ['Key/value list', 'enumeration'], Redmine::FieldFormat.as_select(klass)
120
    end
121
  end
116 122
end
(2-2/2)