mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-28 13:01:04 +00:00
[TESTS] testMiddlewareHook, dependency injection in integration tests
(cherry picked from commit6623630d10) (cherry picked from commit5e30a4f950)
This commit is contained in:
parent
8bd051e6df
commit
355a117e74
6 changed files with 32 additions and 18 deletions
|
|
@ -167,6 +167,10 @@ func Routes(ctx gocontext.Context) *web.Route {
|
|||
mid = append(mid, user.GetNotificationCount)
|
||||
mid = append(mid, repo.GetActiveStopwatch)
|
||||
mid = append(mid, goGet)
|
||||
middlewareHook := ctx.Value(web.KeyTestMiddlewareHook)
|
||||
if middlewareHook != nil {
|
||||
mid = append(mid, middlewareHook)
|
||||
}
|
||||
|
||||
others := web.NewRoute()
|
||||
others.Use(mid...)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue