forked from forgejo/forgejo
[TESTS] testMiddlewareHook, dependency injection in integration tests
(cherry picked from commit 6623630d10
)
This commit is contained in:
parent
03936c6492
commit
5e30a4f950
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