summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/views/attachments/upload.api.rsb1
-rw-r--r--test/integration/api_test/attachments_test.rb3
2 files changed, 4 insertions, 0 deletions
diff --git a/app/views/attachments/upload.api.rsb b/app/views/attachments/upload.api.rsb
index edd0b0af4..6049b2ed7 100644
--- a/app/views/attachments/upload.api.rsb
+++ b/app/views/attachments/upload.api.rsb
@@ -1,3 +1,4 @@
api.upload do
+ api.id @attachment.id
api.token @attachment.token
end
diff --git a/test/integration/api_test/attachments_test.rb b/test/integration/api_test/attachments_test.rb
index 640a78290..c7d2869ee 100644
--- a/test/integration/api_test/attachments_test.rb
+++ b/test/integration/api_test/attachments_test.rb
@@ -111,9 +111,12 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
assert_kind_of Hash, xml['upload']
token = xml['upload']['token']
assert_not_nil token
+ attachment_id = xml['upload']['id']
+ assert_not_nil attachment_id
attachment = Attachment.order('id DESC').first
assert_equal token, attachment.token
+ assert_equal attachment_id, attachment.id.to_s
assert_nil attachment.container
assert_equal 2, attachment.author_id
assert_equal 'File content'.size, attachment.filesize