diff options
Diffstat (limited to 'models/attachment_test.go')
-rw-r--r-- | models/attachment_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/models/attachment_test.go b/models/attachment_test.go index 3984425e48..f38a5beeee 100644 --- a/models/attachment_test.go +++ b/models/attachment_test.go @@ -116,3 +116,15 @@ func TestUpdateAttachment(t *testing.T) { AssertExistsAndLoadBean(t, &Attachment{Name: "new_name"}) } + +func TestGetAttachmentsByUUIDs(t *testing.T) { + assert.NoError(t, PrepareTestDatabase()) + + attachList, err := GetAttachmentsByUUIDs([]string{"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a17", "not-existing-uuid"}) + assert.NoError(t, err) + assert.Equal(t, 2, len(attachList)) + assert.Equal(t, "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", attachList[0].UUID) + assert.Equal(t, "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a17", attachList[1].UUID) + assert.Equal(t, int64(1), attachList[0].IssueID) + assert.Equal(t, int64(5), attachList[1].IssueID) +} |