Support for updating custom fields using the received custom_fields array (#6345, #6403).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4481 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2010-12-10 10:48:16 +00:00
parent 0e19aa4362
commit 3e3315c103
4 changed files with 34 additions and 1 deletions
+17
View File
@@ -284,6 +284,23 @@ class ApiTest::IssuesTest < ActionController::IntegrationTest
end
context "PUT /issues/3.xml with custom fields" do
setup do
@parameters = {:issue => {:custom_fields => [{'id' => '1', 'value' => 'PostgreSQL' }, {'id' => '2', 'value' => '150'}]}}
@headers = { :authorization => credentials('jsmith') }
end
should "update custom fields" do
assert_no_difference('Issue.count') do
put '/issues/3.xml', @parameters, @headers
end
issue = Issue.find(3)
assert_equal '150', issue.custom_value_for(2).value
assert_equal 'PostgreSQL', issue.custom_value_for(1).value
end
end
context "PUT /issues/6.xml with failed update" do
setup do
@parameters = {:issue => {:subject => ''}}