Handling request validation/authentication
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"fmt"
|
||||
"github.com/deluan/gosonic/controllers/responses"
|
||||
"github.com/deluan/gosonic/tests"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -20,13 +21,12 @@ func init() {
|
||||
beego.TestBeegoInit(appPath)
|
||||
}
|
||||
|
||||
// TestGet is a sample to run an endpoint test
|
||||
func TestPing(t *testing.T) {
|
||||
r, _ := http.NewRequest("GET", "/rest/ping.view", nil)
|
||||
r, _ := http.NewRequest("GET", test.AddParams("/rest/ping.view"), nil)
|
||||
w := httptest.NewRecorder()
|
||||
beego.BeeApp.Handlers.ServeHTTP(w, r)
|
||||
|
||||
beego.Trace("testing", "TestPing", fmt.Sprintf("Code[%d]\n%s", w.Code, w.Body.String()))
|
||||
beego.Trace("testing", "TestPing", fmt.Sprintf("\nUrl: %s\n\nCode[%d]\n%s", r.URL, w.Code, w.Body.String()))
|
||||
|
||||
Convey("Subject: Ping Endpoint\n", t, func() {
|
||||
Convey("Status code should be 200", func() {
|
||||
|
||||
Reference in New Issue
Block a user