mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Refactor "route" related code, fix Safari cookie bug (#24330)
Fix #24176 Clean some misuses of route package, clean some legacy FIXMEs --------- Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
@@ -11,11 +11,14 @@ import (
|
||||
)
|
||||
|
||||
func TestRoutes(t *testing.T) {
|
||||
// TODO: this test seems not really testing the handlers
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
routes := Routes(ctx)
|
||||
assert.NotNil(t, routes)
|
||||
assert.EqualValues(t, "/", routes.R.Routes()[0].Pattern)
|
||||
assert.Nil(t, routes.R.Routes()[0].SubRoutes)
|
||||
assert.Len(t, routes.R.Routes()[0].Handlers, 2)
|
||||
base := Routes(ctx)
|
||||
assert.NotNil(t, base)
|
||||
r := base.R.Routes()[1]
|
||||
routes := r.SubRoutes.Routes()[0]
|
||||
assert.EqualValues(t, "/", routes.Pattern)
|
||||
assert.Nil(t, routes.SubRoutes)
|
||||
assert.Len(t, routes.Handlers, 2)
|
||||
}
|
||||
|
Reference in New Issue
Block a user