2021-06-30 02:30:02 +05:30
|
|
|
// Copyright 2021 The Gitea Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a MIT-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package install
|
|
|
|
|
|
|
|
import (
|
2022-08-28 15:13:25 +05:30
|
|
|
"context"
|
2021-06-30 02:30:02 +05:30
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestRoutes(t *testing.T) {
|
2022-08-28 15:13:25 +05:30
|
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
|
|
defer cancel()
|
|
|
|
routes := Routes(ctx)
|
2021-06-30 02:30:02 +05:30
|
|
|
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)
|
|
|
|
}
|