##// END OF EJS Templates
Return attachment id in api response to attachment upload (#23566)....
Jean-Philippe Lang -
r15380:baaa15ebdd0c
parent child
Show More
@@ -1,3 +1,4
1 api.upload do
1 api.upload do
2 api.id @attachment.id
2 api.token @attachment.token
3 api.token @attachment.token
3 end
4 end
@@ -111,9 +111,12 class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
111 assert_kind_of Hash, xml['upload']
111 assert_kind_of Hash, xml['upload']
112 token = xml['upload']['token']
112 token = xml['upload']['token']
113 assert_not_nil token
113 assert_not_nil token
114 attachment_id = xml['upload']['id']
115 assert_not_nil attachment_id
114
116
115 attachment = Attachment.order('id DESC').first
117 attachment = Attachment.order('id DESC').first
116 assert_equal token, attachment.token
118 assert_equal token, attachment.token
119 assert_equal attachment_id, attachment.id.to_s
117 assert_nil attachment.container
120 assert_nil attachment.container
118 assert_equal 2, attachment.author_id
121 assert_equal 2, attachment.author_id
119 assert_equal 'File content'.size, attachment.filesize
122 assert_equal 'File content'.size, attachment.filesize
General Comments 0
You need to be logged in to leave comments. Login now