Tests: Add tests for internal/api

This commit is contained in:
theresa
2021-03-10 16:55:55 +01:00
parent c0d5da40e1
commit 816aca7420
4 changed files with 52 additions and 4 deletions

View File

@@ -16,12 +16,20 @@ func TestDeleteFile(t *testing.T) {
r := PerformRequest(app, "DELETE", "/api/v1/photos/5678/files/23456hbg")
assert.Equal(t, http.StatusNotFound, r.Code)
})
/*t.Run("delete primary file", func(t *testing.T) {
t.Run("delete primary file", func(t *testing.T) {
app, router, _ := NewApiTest()
DeleteFile(router)
r := PerformRequest(app, "DELETE", "/api/v1/photos/pt9jtdre2lvl0yh7/files/ft8es39w45bnlqdw")
assert.Equal(t, http.StatusInternalServerError, r.Code)
})
t.Run("try to delete file", func(t *testing.T) {
app, router, _ := NewApiTest()
DeleteFile(router)
r := PerformRequest(app, "DELETE", "/api/v1/photos/pt9jtdre2lvl0yh8/files/ft9es39w45bnlqdw")
assert.Equal(t, http.StatusNotFound, r.Code)
})*/
})
}