summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2022-09-01 05:25:04 +0000
committerGo MAEDA <maeda@farend.jp>2022-09-01 05:25:04 +0000
commit099a9adcb30054b7a58bcea61c5bd5d39c17f9ad (patch)
treef7b031aceda06866b72481dbe32b24b6a798a116
parent6755063664241d02043eb8c12a97c1377cd72e11 (diff)
downloadredmine-099a9adcb30054b7a58bcea61c5bd5d39c17f9ad.tar.gz
redmine-099a9adcb30054b7a58bcea61c5bd5d39c17f9ad.zip
Add description field to custom fields API (#37617).
Patch by Holger Just and Go MAEDA. git-svn-id: https://svn.redmine.org/redmine/trunk@21793 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/views/custom_fields/index.api.rsb1
-rw-r--r--test/fixtures/custom_fields.yml1
-rw-r--r--test/integration/api_test/custom_fields_test.rb1
3 files changed, 3 insertions, 0 deletions
diff --git a/app/views/custom_fields/index.api.rsb b/app/views/custom_fields/index.api.rsb
index 8233ed140..9f46f89f2 100644
--- a/app/views/custom_fields/index.api.rsb
+++ b/app/views/custom_fields/index.api.rsb
@@ -3,6 +3,7 @@ api.array :custom_fields do
api.custom_field do
api.id field.id
api.name field.name
+ api.description field.description
api.customized_type field.class.customized_class.name.underscore if field.class.customized_class
api.field_format field.field_format
api.regexp field.regexp
diff --git a/test/fixtures/custom_fields.yml b/test/fixtures/custom_fields.yml
index 98dccdfcb..0ca34ab9f 100644
--- a/test/fixtures/custom_fields.yml
+++ b/test/fixtures/custom_fields.yml
@@ -1,6 +1,7 @@
---
custom_fields_001:
name: Database
+ description: Select one of the databases
regexp: ""
is_for_all: true
is_filter: true
diff --git a/test/integration/api_test/custom_fields_test.rb b/test/integration/api_test/custom_fields_test.rb
index 4db397b1a..30a5c6f7a 100644
--- a/test/integration/api_test/custom_fields_test.rb
+++ b/test/integration/api_test/custom_fields_test.rb
@@ -30,6 +30,7 @@ class Redmine::ApiTest::CustomFieldsTest < Redmine::ApiTest::Base
assert_select 'custom_fields' do
assert_select 'custom_field' do
assert_select 'name', :text => 'Database'
+ assert_select 'description', :text => 'Select one of the databases'
assert_select 'id', :text => '2'
assert_select 'customized_type', :text => 'issue'
assert_select 'possible_values[type=array]' do