Files
huangguo_server/app/router/vid_consume_route_test.go
rootandClaude Opus 5 8679200f41 Initial commit
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:10 +08:00

31 lines
680 B
Go

package router
import (
"testing"
"github.com/gin-gonic/gin"
)
func TestVideoPlayConsumeRoute(t *testing.T) {
gin.SetMode(gin.TestMode)
engine := gin.New()
vidRouter(engine.Group("/api/app"))
foundConsume := false
foundLegacyCount := false
for _, route := range engine.Routes() {
if route.Method == "POST" && route.Path == "/api/app/vid/play/consume" {
foundConsume = true
}
if route.Method == "GET" && route.Path == "/api/app/vid/user/count" {
foundLegacyCount = true
}
}
if !foundConsume {
t.Error("POST /api/app/vid/play/consume is not registered")
}
if !foundLegacyCount {
t.Error("legacy GET /api/app/vid/user/count is not registered")
}
}