Migrate from templates to Gomponents (#103)
This commit is contained in:
parent
0bf9ab7189
commit
051d032038
104 changed files with 2768 additions and 2824 deletions
22
pkg/middleware/config_test.go
Normal file
22
pkg/middleware/config_test.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package middleware
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/mikestefanello/pagoda/config"
|
||||
"github.com/mikestefanello/pagoda/pkg/context"
|
||||
"github.com/mikestefanello/pagoda/pkg/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