|
|
@@ -3,14 +3,13 @@ package web
|
|
|
import (
|
|
|
"testing"
|
|
|
|
|
|
- "github.com/gin-gonic/gin"
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
)
|
|
|
|
|
|
func TestNewServer_routes(t *testing.T) {
|
|
|
s := NewServer()
|
|
|
routes := s.router.Routes()
|
|
|
- checkedRoutes := make(map[gin.RouteInfo]bool)
|
|
|
+ checkedRoutes := make(map[string]bool)
|
|
|
|
|
|
tests := []struct {
|
|
|
path string
|
|
|
@@ -31,7 +30,7 @@ func TestNewServer_routes(t *testing.T) {
|
|
|
})
|
|
|
|
|
|
ran = true
|
|
|
- checkedRoutes[route] = true
|
|
|
+ checkedRoutes[route.Path] = true
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
@@ -41,7 +40,7 @@ func TestNewServer_routes(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
for _, route := range routes {
|
|
|
- if !checkedRoutes[route] {
|
|
|
+ if !checkedRoutes[route.Path] {
|
|
|
assert.Failf(t, "Unchecked route", "Didn't check %s", route.Path)
|
|
|
}
|
|
|
}
|