blob: e9cd76f8250624e8c99a7fe77d50e516c7a7c413 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package factory
import (
"testing"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-pages/internal/source/gitlab/api"
)
func TestLookupPath(t *testing.T) {
t.Run("when lookup path is not a namespace project", func(t *testing.T) {
lookup := api.LookupPath{Prefix: "/something"}
path := LookupPath(1, lookup)
require.Equal(t, path.Prefix, "/something")
require.False(t, path.IsNamespaceProject)
})
t.Run("when lookup path is a namespace project", func(t *testing.T) {
lookup := api.LookupPath{Prefix: "/"}
path := LookupPath(2, lookup)
require.Equal(t, path.Prefix, "/")
require.True(t, path.IsNamespaceProject)
})
}
|