fix attachments unit tests

stable
Juanfran 2016-01-22 14:13:11 +01:00
parent b5e61863c7
commit 3943d4037e
2 changed files with 8 additions and 1 deletions

View File

@ -43,6 +43,8 @@ class AttachmentController
save: () ->
attachment = @.attachment.set('loading', true)
@.onUpdate({attachment: attachment})
attachment = @.attachment.merge({
editable: false,
loading: false

View File

@ -123,6 +123,11 @@ class AttachmentsFullService extends taiga.Service
patch = taiga.patch(oldAttachment.get('file'), toUpdateAttachment.get('file'))
if toUpdateAttachment.get('loading')
@._attachments = @._attachments.set(index, toUpdateAttachment)
@.regenerate()
else
return @attachmentsService.patch(toUpdateAttachment.getIn(['file', 'id']), type, patch).then () =>
@._attachments = @._attachments.set(index, toUpdateAttachment)