Removed echo-contrib dependency.
This commit is contained in:
parent
8eafb6b666
commit
75aefa8a0a
13 changed files with 108 additions and 18 deletions
24
pkg/middleware/session_test.go
Normal file
24
pkg/middleware/session_test.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package middleware
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gorilla/sessions"
|
||||
"github.com/mikestefanello/pagoda/pkg/session"
|
||||
"github.com/mikestefanello/pagoda/pkg/tests"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestSession(t *testing.T) {
|
||||
ctx, _ := tests.NewContext(c.Web, "/")
|
||||
_, err := session.Get(ctx, "test")
|
||||
assert.Equal(t, session.ErrStoreNotFound, err)
|
||||
|
||||
store := sessions.NewCookieStore([]byte("secret"))
|
||||
err = tests.ExecuteMiddleware(ctx, Session(store))
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = session.Get(ctx, "test")
|
||||
assert.NotEqual(t, session.ErrStoreNotFound, err)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue