summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-09 07:55:26 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-09 07:55:26 +0000
commit9f788310b1b828cebeafcff6d3231d659dfbf6ac (patch)
tree45e72cdd78e9fbd9b54c74d0ecdaf443dcd62023 /test/integration
parent7fba8bc682431baa7bcaf4c862fd6ca70b9eb053 (diff)
downloadredmine-9f788310b1b828cebeafcff6d3231d659dfbf6ac.tar.gz
redmine-9f788310b1b828cebeafcff6d3231d659dfbf6ac.zip
Fixed that custom_fields property is ignored for time entries in REST API (#11112).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9783 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/api_test/time_entries_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/integration/api_test/time_entries_test.rb b/test/integration/api_test/time_entries_test.rb
index 7a220678c..b18013496 100644
--- a/test/integration/api_test/time_entries_test.rb
+++ b/test/integration/api_test/time_entries_test.rb
@@ -79,6 +79,21 @@ class ApiTest::TimeEntriesTest < ActionController::IntegrationTest
assert_equal 3.5, entry.hours
assert_equal TimeEntryActivity.find(11), entry.activity
end
+
+ should "accept custom fields" do
+ field = TimeEntryCustomField.create!(:name => 'Test', :field_format => 'string')
+
+ assert_difference 'TimeEntry.count' do
+ post '/time_entries.xml', {:time_entry => {
+ :issue_id => '1', :spent_on => '2010-12-02', :hours => '3.5', :activity_id => '11', :custom_fields => [{:id => field.id.to_s, :value => 'accepted'}]
+ }}, credentials('jsmith')
+ end
+ assert_response :created
+ assert_equal 'application/xml', @response.content_type
+
+ entry = TimeEntry.first(:order => 'id DESC')
+ assert_equal 'accepted', entry.custom_field_value(field)
+ end
end
context "with project_id" do