Skip to content

Commit

Permalink
Changes in test
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshal101 committed Dec 14, 2023
1 parent c441fb6 commit 4450ae6
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions tests/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,46 +45,3 @@ func TestGetSignupHandler(t *testing.T) {
assert.Equal(t, mockResponse, string(responseData))
assert.Equal(t, http.StatusOK, w.Code)
}

// func TestSignUpHandler(t *testing.T) {

// r := SetUpRouter()
// r.POST("/signup", handlers.SignUpHandler)
// user := models.SignUp{
// Username: "test",
// Password: "654321",
// Email: "[email protected]",
// Phone: "879546213",
// }
// jsonValue, _ := json.Marshal(&user)
// req, _ := http.NewRequest("POST", "/signup", bytes.NewBuffer(jsonValue))

// w := httptest.NewRecorder()
// r.ServeHTTP(w, req)
// assert.Equal(t, http.StatusCreated, w.Code)
// }

// func TestLoginHandler(t *testing.T) {
// r := SetUpRouter()
// r.POST("/login", handlers.LoginHandler)
// loginUser := models.LoginRequest{
// Username: "test",
// Password: "654321",
// }
// jsonValue, err := json.Marshal(&loginUser)
// assert.NoError(t, err)

// req, err := http.NewRequest("POST", "/login", bytes.NewBuffer(jsonValue))
// assert.NoError(t, err)

// req.Header.Set("Content-Type", "application/json")

// w := httptest.NewRecorder()

// r.ServeHTTP(w, req)
// assert.Equal(t, http.StatusOK, w.Code)

// var response map[string]string
// err = json.Unmarshal(w.Body.Bytes(), &response)
// assert.NoError(t, err)
// }

0 comments on commit 4450ae6

Please sign in to comment.