- first runnable ver.

This commit is contained in:
gazebo
2018-05-31 11:08:57 +08:00
parent e59373b033
commit 8d1c22229b
7 changed files with 23 additions and 17 deletions

View File

@@ -3,10 +3,11 @@ package test
import (
"net/http"
"net/http/httptest"
"testing"
"runtime"
"path/filepath"
_ "jx-callback/routers"
"runtime"
"testing"
_ "git.rosy.net.cn/jx-callback/routers"
"github.com/astaxie/beego"
. "github.com/smartystreets/goconvey/convey"
@@ -14,7 +15,7 @@ import (
func init() {
_, file, _, _ := runtime.Caller(1)
apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".." + string(filepath.Separator))))
apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
beego.TestBeegoInit(apppath)
}
@@ -27,12 +28,11 @@ func TestGet(t *testing.T) {
beego.Trace("testing", "TestGet", "Code[%d]\n%s", w.Code, w.Body.String())
Convey("Subject: Test Station Endpoint\n", t, func() {
Convey("Status Code Should Be 200", func() {
So(w.Code, ShouldEqual, 200)
})
Convey("The Result Should Not Be Empty", func() {
So(w.Body.Len(), ShouldBeGreaterThan, 0)
})
Convey("Status Code Should Be 200", func() {
So(w.Code, ShouldEqual, 200)
})
Convey("The Result Should Not Be Empty", func() {
So(w.Body.Len(), ShouldBeGreaterThan, 0)
})
})
}