mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-14 19:20:37 +03:00
Better test messaging
This commit is contained in:
parent
1a20a1217b
commit
8ffa93780d
@ -11,17 +11,17 @@ import (
|
||||
_ "github.com/deluan/gosonic/routers"
|
||||
)
|
||||
|
||||
func TestMainController(t *testing.T) {
|
||||
func TestErrorHandler(t *testing.T) {
|
||||
tests.Init(t, false)
|
||||
|
||||
r, _ := http.NewRequest("GET", "/INVALID_PATH", nil)
|
||||
w := httptest.NewRecorder()
|
||||
beego.BeeApp.Handlers.ServeHTTP(w, r)
|
||||
|
||||
beego.Debug("testing", "TestMainController", fmt.Sprintf("\nUrl: %s\nStatus Code: [%d]\n%s", r.URL, w.Code, w.Body.String()))
|
||||
beego.Debug("testing", "TestErrorHandler", fmt.Sprintf("\nUrl: %s\nStatus Code: [%d]\n%s", r.URL, w.Code, w.Body.String()))
|
||||
|
||||
Convey("Subject: Error404\n", t, func() {
|
||||
Convey("Status code should be 404", func() {
|
||||
Convey("When requesting an non-existing URL\n", t, func() {
|
||||
Convey("Then the status code should be 404", func() {
|
||||
So(w.Code, ShouldEqual, 404)
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user