diff --git a/backend/tests/api/user_test.go b/backend/tests/api/user_test.go index 8815b8384..e7e830608 100644 --- a/backend/tests/api/user_test.go +++ b/backend/tests/api/user_test.go @@ -1,23 +1,17 @@ package tests import ( -<<<<<<< Updated upstream - "net/http" -======= "fmt" "io" + "net/http" "net/http/httptest" "strings" ->>>>>>> Stashed changes "testing" "github.com/GenerateNU/sac/backend/src/models" "github.com/GenerateNU/sac/backend/src/transactions" -<<<<<<< Updated upstream "github.com/huandu/go-assert" -======= ->>>>>>> Stashed changes "github.com/goccy/go-json" ) @@ -70,18 +64,13 @@ func TestDeleteUserWorks(t *testing.T) { } err := app.Conn.Create(&user).Error assert.NilError(err) - app, assert, resp := RequestTesterWithJSONBody(t, "DELETE", fmt.Sprintf("%s/api/v1/users/%d", app.Address, user.ID), nil, nil, app, assert) - assert.Equal(resp.StatusCode, 200) - // req := httptest.NewRequest("DELETE", fmt.Sprintf("%s/api/v1/users/%d", app.Address, user.ID), nil) - // req.Header.Set("Content-Type", "application/json")å - // resp, _ := app.App.Test(req) - // assert.Equal(resp.StatusCode, 200) + req := httptest.NewRequest("DELETE", fmt.Sprintf("%s/api/v1/users/%d", app.Address, user.ID), nil) + req.Header.Set("Content-Type", "application/json") + resp, _ := app.App.Test(req) + assert.Equal(resp.StatusCode, 200) } - - - func TestDeleteUserNotExist(t *testing.T) { app, assert := InitTest(t)