Added a basic homepage
This commit is contained in:
parent
d40640a648
commit
12fd3c04ca
113 changed files with 414 additions and 506 deletions
|
|
@ -1,23 +0,0 @@
|
|||
package middleware
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/camzawacki/personal-site/ent"
|
||||
"github.com/camzawacki/personal-site/pkg/context"
|
||||
"github.com/camzawacki/personal-site/pkg/tests"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestLoadUser(t *testing.T) {
|
||||
ctx, _ := tests.NewContext(c.Web, "/")
|
||||
ctx.SetParamNames("user")
|
||||
ctx.SetParamValues(fmt.Sprintf("%d", usr.ID))
|
||||
_ = tests.ExecuteMiddleware(ctx, LoadUser(c.ORM))
|
||||
ctxUsr, ok := ctx.Get(context.UserKey).(*ent.User)
|
||||
require.True(t, ok)
|
||||
assert.Equal(t, usr.ID, ctxUsr.ID)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue