diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-27 14:06:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-27 02:06:45 -0400 |
commit | 92fd3fc4fd369b6a8c0a022a32a80dec2340223a (patch) | |
tree | c721a4988b5ec250a029b19274ef1c2dc4c19faa /routers/install/routes_test.go | |
parent | 1c875ef5bef206b8214c33437f65af929967df46 (diff) | |
download | gitea-92fd3fc4fd369b6a8c0a022a32a80dec2340223a.tar.gz gitea-92fd3fc4fd369b6a8c0a022a32a80dec2340223a.zip |
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>
Diffstat (limited to 'routers/install/routes_test.go')
-rw-r--r-- | routers/install/routes_test.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/routers/install/routes_test.go b/routers/install/routes_test.go index 35b5e5e916..e3d2a42467 100644 --- a/routers/install/routes_test.go +++ b/routers/install/routes_test.go @@ -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) } |