aboutsummaryrefslogtreecommitdiffstats
path: root/services/repository/avatar_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/repository/avatar_test.go')
-rw-r--r--services/repository/avatar_test.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/services/repository/avatar_test.go b/services/repository/avatar_test.go
index 4a0ba61853..2dc5173eec 100644
--- a/services/repository/avatar_test.go
+++ b/services/repository/avatar_test.go
@@ -59,5 +59,13 @@ func TestDeleteAvatar(t *testing.T) {
err = DeleteAvatar(db.DefaultContext, repo)
assert.NoError(t, err)
- assert.Equal(t, "", repo.Avatar)
+ assert.Empty(t, repo.Avatar)
+}
+
+func TestGenerateAvatar(t *testing.T) {
+ templateRepo := &repo_model.Repository{ID: 10, Avatar: "a"}
+ generateRepo := &repo_model.Repository{ID: 11}
+ _ = generateAvatar(db.DefaultContext, templateRepo, generateRepo)
+ assert.NotEmpty(t, generateRepo.Avatar)
+ assert.NotEqual(t, templateRepo.Avatar, generateRepo.Avatar)
}