diff --git a/tests/api_test.go b/tests/api_test.go index c2a1995..e253551 100644 --- a/tests/api_test.go +++ b/tests/api_test.go @@ -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: "rohan@mail.com", -// 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) -// }