diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-03-14 09:53:36 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-03-14 09:53:36 +0000 |
commit | 5e1d042c40ac8d2b19ab7c7c951623386d93191b (patch) | |
tree | 915794c0fafd82b91cebd23178e6f73016a28cf5 /test/integration | |
parent | b5bf65e834e4b77a425fb772445f9bfe4cf48e64 (diff) | |
download | redmine-5e1d042c40ac8d2b19ab7c7c951623386d93191b.tar.gz redmine-5e1d042c40ac8d2b19ab7c7c951623386d93191b.zip |
Fixed that creating an issue without tracker_id attribute ignores custom field values (#19368).
git-svn-id: http://svn.redmine.org/redmine/trunk@14083 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/api_test/issues_test.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/integration/api_test/issues_test.rb b/test/integration/api_test/issues_test.rb index 89550f1cf..344962a5b 100644 --- a/test/integration/api_test/issues_test.rb +++ b/test/integration/api_test/issues_test.rb @@ -406,6 +406,35 @@ JSON assert_equal 'API test', issue.subject end + test "POST /issues.json without tracker_id should accept custom fields" do + field = IssueCustomField.generate!( + :field_format => 'list', + :multiple => true, + :possible_values => ["V1", "V2", "V3"], + :default_value => "V2", + :is_for_all => true, + :trackers => Tracker.all.to_a + ) + +payload = <<-JSON +{ + "issue": { + "project_id": "1", + "subject": "Multivalued custom field", + "custom_field_values":{"#{field.id}":["V1","V3"]} + } +} +JSON + + assert_difference('Issue.count') do + post '/issues.json', payload, {"CONTENT_TYPE" => 'application/json'}.merge(credentials('jsmith')) + end + + assert_response :created + issue = Issue.order('id DESC').first + assert_equal ["V1", "V3"], issue.custom_field_value(field) + end + test "POST /issues.json with failure should return errors" do assert_no_difference('Issue.count') do post '/issues.json', {:issue => {:project_id => 1}}, credentials('jsmith') |