Project

General

Profile

Feature #23566 ยป 0001-return-attachment-id-in-api-response-to-attachment-u.patch

Jan from Planio www.plan.io, 2016-08-15 11:55

View differences:

app/views/attachments/upload.api.rsb
api.upload do
api.id @attachment.id
api.token @attachment.token
end
test/integration/api_test/attachments_test.rb
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
    (1-1/1)