2021-06-29 17:00:02 -04:00
|
|
|
// Copyright 2021 The Gitea Authors. All rights reserved.
|
2022-11-27 13:20:29 -05:00
|
|
|
// SPDX-License-Identifier: MIT
|
2021-06-29 17:00:02 -04:00
|
|
|
|
|
|
|
package install
|
|
|
|
|
|
|
|
import (
|
2022-08-28 05:43:25 -04:00
|
|
|
"context"
|
2021-06-29 17:00:02 -04:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestRoutes(t *testing.T) {
|
2022-08-28 05:43:25 -04:00
|
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
|
|
defer cancel()
|
|
|
|
routes := Routes(ctx)
|
2021-06-29 17:00:02 -04:00
|
|
|
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)
|
|
|
|
}
|