feat(*): 系统渠道与画布 - 支持多规格批量调价及 Agent 入口拖动
This commit is contained in:
1 parent
9afe061d79
commit
8d94bde1f4
26 files changed
+1761
-44
No files matched your search
@@ -1,6 +1,8 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"infinite-canvas/backend/internal/service"
|
||||
@@ -21,3 +23,24 @@ func TestFinanceRoutesExposeChannelModelBatchDelete(t *testing.T) {
|
||||
}
|
||||
t.Fatalf("route %s is not registered", wanted)
|
||||
}
|
||||
|
||||
func TestFinanceRoutesExposeChannelModelBatchReprice(t *testing.T) {
|
||||
gin.SetMode(gin.TestMode)
|
||||
router := gin.New()
|
||||
RegisterFinanceRoutes(router.Group("/api"), &service.Service{})
|
||||
const wanted = "POST /api/admin/channels/:id/models/batch-reprice"
|
||||
found := false
|
||||
for _, route := range router.Routes() {
|
||||
if route.Method+" "+route.Path == wanted {
|
||||
found = true
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
t.Fatalf("route %s is not registered", wanted)
|
||||
}
|
||||
response := httptest.NewRecorder()
|
||||
router.ServeHTTP(response, httptest.NewRequest(http.MethodPost, "/api/admin/channels/channel/models/batch-reprice", nil))
|
||||
if response.Code != http.StatusUnauthorized {
|
||||
t.Fatalf("unauthenticated status = %d, body = %s", response.Code, response.Body.String())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user