mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 17:56:03 +01:00
Return attachment id in api response to attachment upload (#23566).
Patch by Jan Schulz-Hofen. git-svn-id: http://svn.redmine.org/redmine/trunk@15762 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
api.upload do
|
api.upload do
|
||||||
|
api.id @attachment.id
|
||||||
api.token @attachment.token
|
api.token @attachment.token
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -111,9 +111,12 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
|
|||||||
assert_kind_of Hash, xml['upload']
|
assert_kind_of Hash, xml['upload']
|
||||||
token = xml['upload']['token']
|
token = xml['upload']['token']
|
||||||
assert_not_nil token
|
assert_not_nil token
|
||||||
|
attachment_id = xml['upload']['id']
|
||||||
|
assert_not_nil attachment_id
|
||||||
|
|
||||||
attachment = Attachment.order('id DESC').first
|
attachment = Attachment.order('id DESC').first
|
||||||
assert_equal token, attachment.token
|
assert_equal token, attachment.token
|
||||||
|
assert_equal attachment_id, attachment.id.to_s
|
||||||
assert_nil attachment.container
|
assert_nil attachment.container
|
||||||
assert_equal 2, attachment.author_id
|
assert_equal 2, attachment.author_id
|
||||||
assert_equal 'File content'.size, attachment.filesize
|
assert_equal 'File content'.size, attachment.filesize
|
||||||
|
|||||||
Reference in New Issue
Block a user