mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-13 14:59:03 +00:00
Task GET
This commit is contained in:
@@ -3,6 +3,7 @@ package test
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/google/uuid"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"src/task_tracker/api"
|
||||
@@ -21,13 +22,13 @@ func TestCreateGetWorker(t *testing.T) {
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
getResp, r := getWorker(resp.WorkerId)
|
||||
getResp, r := getWorker(resp.WorkerId.String())
|
||||
|
||||
if r.StatusCode != 200 {
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
if resp.WorkerId != getResp.Worker.Id.String() {
|
||||
if resp.WorkerId != getResp.Worker.Id {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
@@ -81,3 +82,9 @@ func getWorker(id string) (*api.GetWorkerResponse, *http.Response) {
|
||||
|
||||
return resp, r
|
||||
}
|
||||
|
||||
func genWid() *uuid.UUID {
|
||||
|
||||
resp, _ := createWorker(api.CreateWorkerRequest{})
|
||||
return &resp.WorkerId
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user