diff --git a/greataped/tests/profile_test.go b/greataped/tests/profile_test.go new file mode 100644 index 0000000..eaca358 --- /dev/null +++ b/greataped/tests/profile_test.go @@ -0,0 +1,35 @@ +package tests + +import ( + "fmt" + "net/http" + "testing" + + "github.com/google/uuid" +) + +func TestProfile(t *testing.T) { + id := uuid.New().String() + + resp, err := Post("/api/v1/signup", Payload{ + "email": fmt.Sprintf("%s@%s", id, DOMAIN), + "password": "123456", + "username": id, + }) + if err != nil { + t.Fatal(err) + } + + if resp.StatusCode != http.StatusOK { + t.FailNow() + } + + resp, err = Get(fmt.Sprintf("/u/%s", id)) + if err != nil { + t.Fatal(err) + } + + if resp.StatusCode != http.StatusOK { + t.FailNow() + } +}