Skip to content

Commit

Permalink
Final user test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
in-mai-space committed Jan 20, 2024
1 parent c8a891e commit e7f7310
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions backend/tests/api/user_test.go
Original file line number Diff line number Diff line change
@@ -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"
)

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit e7f7310

Please sign in to comment.