mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-13 23:09:02 +00:00
Web dashboard, task release, logs api
This commit is contained in:
28
test/api_index_test.go
Normal file
28
test/api_index_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"src/task_tracker/api"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestIndex(t *testing.T) {
|
||||
|
||||
r := Get("/")
|
||||
|
||||
body, _ := ioutil.ReadAll(r.Body)
|
||||
var info api.Info
|
||||
err := json.Unmarshal(body, &info)
|
||||
|
||||
if err != nil {
|
||||
t.Error(err.Error())
|
||||
}
|
||||
|
||||
if len(info.Name) <= 0 {
|
||||
t.Error()
|
||||
}
|
||||
if len(info.Version) <= 0 {
|
||||
t.Error()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user