|
|
|
@ -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) |
|
|
|
|
} |
|
|
|
|