Refactor CustomFieldsControllerTest#custom_field_classes (#40008).

git-svn-id: https://svn.redmine.org/redmine/trunk@22597 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2024-01-08 01:14:31 +00:00
parent 52a55f407b
commit fc26af7136

View File

@@ -594,10 +594,10 @@ class CustomFieldsControllerTest < Redmine::ControllerTest
end end
def custom_field_classes def custom_field_classes
files = classes =
Dir.glob(File.join(Rails.root, 'app/models/*_custom_field.rb')). Dir.glob(Rails.root.join('app/models/*_custom_field.rb')).map do |f|
map {|f| File.basename(f).delete_suffix('.rb')} File.basename(f, '.rb').classify.constantize
classes = files.map {|x| x.classify.constantize} end
assert classes.size > 0 assert classes.size > 0
classes classes
end end