11 "github.com/astaxie/beego"
12 . "github.com/smartystreets/goconvey/convey"
16 _, file, _, _ := runtime.Caller(1)
17 apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".." + string(filepath.Separator))))
18 beego.TestBeegoInit(apppath)
22 // TestBeego is a sample to run an endpoint test
23 func TestBeego(t *testing.T) {
24 r, _ := http.NewRequest("GET", "/", nil)
25 w := httptest.NewRecorder()
26 beego.BeeApp.Handlers.ServeHTTP(w, r)
28 beego.Trace("testing", "TestBeego", "Code[%d]\n%s", w.Code, w.Body.String())
30 Convey("Subject: Test Station Endpoint\n", t, func() {
31 Convey("Status Code Should Be 200", func() {
32 So(w.Code, ShouldEqual, 200)
34 Convey("The Result Should Not Be Empty", func() {
35 So(w.Body.Len(), ShouldBeGreaterThan, 0)