Added a basic homepage
This commit is contained in:
parent
d40640a648
commit
12fd3c04ca
113 changed files with 414 additions and 506 deletions
22
internal/middleware/config_test.go
Normal file
22
internal/middleware/config_test.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package middleware
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/camzawacki/personal-site/config"
|
||||
"github.com/camzawacki/personal-site/internal/context"
|
||||
"github.com/camzawacki/personal-site/internal/tests"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestConfig(t *testing.T) {
|
||||
ctx, _ := tests.NewContext(c.Web, "/")
|
||||
cfg := &config.Config{}
|
||||
err := tests.ExecuteMiddleware(ctx, Config(cfg))
|
||||
require.NoError(t, err)
|
||||
|
||||
got, ok := ctx.Get(context.ConfigKey).(*config.Config)
|
||||
require.True(t, ok)
|
||||
assert.Same(t, got, cfg)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue