Fixing more stuff

This commit is contained in:
2022-02-06 18:27:30 +01:00
parent 8bc01e0984
commit e582a75d9e
13 changed files with 56 additions and 38 deletions

View File

@@ -20,12 +20,12 @@ func TestAssetsGet(t *testing.T) {
{
"name": "linux",
"data": "this should be an image of tux :3",
"link": "/assets/linux",
"link": "assets/linux",
},
{
"name": "get test",
"data": "",
"link": "/assets/get-test",
"link": "assets/get-test",
},
})
@@ -47,7 +47,7 @@ func TestAssetsGet(t *testing.T) {
{
Id: 1,
Name: "linux",
Link: "/assets/linux",
Link: "assets/linux",
},
},
Code: http.StatusOK,
@@ -64,7 +64,7 @@ func TestAssetsGet(t *testing.T) {
{
Id: 1,
Name: "linux",
Link: "/assets/linux",
Link: "assets/linux",
},
},
Code: http.StatusOK,
@@ -78,12 +78,12 @@ func TestAssetsGet(t *testing.T) {
{
Id: 1,
Name: "linux",
Link: "/assets/linux",
Link: "assets/linux",
},
{
Id: 2,
Name: "get test",
Link: "/assets/get-test",
Link: "assets/get-test",
},
},
Code: http.StatusOK,
@@ -124,7 +124,7 @@ func TestAssetsPost(t *testing.T) {
ResultBody: schema.Asset{
Id: 1,
Name: "test",
Link: "/assets/test",
Link: "assets/test",
},
Code: http.StatusCreated,
},
@@ -150,7 +150,7 @@ func TestAssetsDelete(t *testing.T) {
database.GetDB().Table("assets").Create(map[string]interface{}{
"name": "example",
"data": "just a normal string",
"link": "/assets/example",
"link": "assets/example",
})
server := httptest.NewServer(http.HandlerFunc(assetsDelete))