diff --git a/server/account_test.go b/server/account_test.go index 1540ff3..f0f9795 100644 --- a/server/account_test.go +++ b/server/account_test.go @@ -39,13 +39,19 @@ func TestRegisterUser(t *testing.T) { http.MethodPost, "/api/v1/user/register", strings.NewReader(`{"password":"pass","email":"info@example.com","name":"Test"}`)) + request.Header.Set("Content-Type", "application/json") context := engine.NewContext(request, recorder) if err != nil { t.Errorf("error creating request: %s", err) return } - h.registerPost(context) + err = h.registerPost(context) + if err != nil { + t.Error(err.Error()) + t.Error("Error registering") + return + } if recorder.Code != http.StatusOK { t.Errorf("handler returned wrong status code: got %v want %v", recorder.Code, http.StatusOK)