Implement get goals (#25)

Closes #13

Reviewed-on: #25
This commit was merged in pull request #25.
This commit is contained in:
2025-05-08 11:51:16 +02:00
parent 5a19fc041d
commit aa26a8f338
4 changed files with 95 additions and 3 deletions

View File

@@ -40,3 +40,19 @@ func TestGetUserBadId(t *testing.T) {
e := startServer(t)
e.GET("/user/bad-id").Expect().Status(400)
}
func TestGetUserGoalsWhenNoGoalsPresent(t *testing.T) {
e := startServer(t)
result := e.GET("/user/1/goals").Expect().Status(200).JSON().Array()
result.Length().IsEqual(0)
}
func TestGetUserGoalsNoUser(t *testing.T) {
e := startServer(t)
e.GET("/user/999/goals").Expect().Status(404)
}
func TestGetUserGoalsBadId(t *testing.T) {
e := startServer(t)
e.GET("/user/bad-id/goals").Expect().Status(400)
}