summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-05-08 08:44:53 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-05-08 08:44:53 +0000
commit60bb7565dd8460137974bdaa0e25c97907ea6ee7 (patch)
tree2633c92273870f225a070ad88cd1d17a91cc1a62 /test/integration
parentb5bc96a90f0746a9fff884074cb7d05256d9d698 (diff)
downloadredmine-60bb7565dd8460137974bdaa0e25c97907ea6ee7.tar.gz
redmine-60bb7565dd8460137974bdaa0e25c97907ea6ee7.zip
Include value and label of possible values in custom fields API (#22745).
git-svn-id: http://svn.redmine.org/redmine/trunk@15401 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/api_test/custom_fields_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/integration/api_test/custom_fields_test.rb b/test/integration/api_test/custom_fields_test.rb
index 54f8b8966..c3efa6b9b 100644
--- a/test/integration/api_test/custom_fields_test.rb
+++ b/test/integration/api_test/custom_fields_test.rb
@@ -32,10 +32,25 @@ class Redmine::ApiTest::CustomFieldsTest < Redmine::ApiTest::Base
assert_select 'customized_type', :text => 'issue'
assert_select 'possible_values[type=array]' do
assert_select 'possible_value>value', :text => 'PostgreSQL'
+ assert_select 'possible_value>label', :text => 'PostgreSQL'
end
assert_select 'trackers[type=array]'
assert_select 'roles[type=array]'
end
end
end
+
+ test "GET /custom_fields.xml should include value and label for enumeration custom fields" do
+ field = IssueCustomField.generate!(:field_format => 'enumeration')
+ foo = field.enumerations.create!(:name => 'Foo')
+ bar = field.enumerations.create!(:name => 'Bar')
+
+ get '/custom_fields.xml', {}, credentials('admin')
+ assert_response :success
+
+ assert_select 'possible_value' do
+ assert_select "value:contains(?) + label:contains(?)", foo.id.to_s, 'Foo'
+ assert_select "value:contains(?) + label:contains(?)", bar.id.to_s, 'Bar'
+ end
+ end
end