summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2024-05-16 08:38:04 +0000
committerGo MAEDA <maeda@farend.jp>2024-05-16 08:38:04 +0000
commitf4c7e08d0f4601bdbfade1c5c216a759daeb29d9 (patch)
tree2f20c15417064844a225a1e8762dce743e795ad7 /test/unit
parent9189837e7bd1066f267ebad54620bb21ef17af63 (diff)
downloadredmine-f4c7e08d0f4601bdbfade1c5c216a759daeb29d9.tar.gz
redmine-f4c7e08d0f4601bdbfade1c5c216a759daeb29d9.zip
Key/value-pair custom field type not available to all customizable contents (#27543).
Patch by Felix Schäfer (@felix) and Takenori TAKAKI (@takenory). git-svn-id: https://svn.redmine.org/redmine/trunk@22834 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/lib/redmine/field_format/enumeration_format_test.rb4
-rw-r--r--test/unit/lib/redmine/field_format/field_format_test.rb6
2 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/field_format/enumeration_format_test.rb b/test/unit/lib/redmine/field_format/enumeration_format_test.rb
index 74a637fc4..fdae2ff6f 100644
--- a/test/unit/lib/redmine/field_format/enumeration_format_test.rb
+++ b/test/unit/lib/redmine/field_format/enumeration_format_test.rb
@@ -98,4 +98,8 @@ class Redmine::EnumerationFieldFormatTest < ActionView::TestCase
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
diff --git a/test/unit/lib/redmine/field_format/field_format_test.rb b/test/unit/lib/redmine/field_format/field_format_test.rb
index f71d83e34..6418917f2 100644
--- a/test/unit/lib/redmine/field_format/field_format_test.rb
+++ b/test/unit/lib/redmine/field_format/field_format_test.rb
@@ -111,4 +111,10 @@ class Redmine::FieldFormatTest < ActionView::TestCase
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