Removed echo-contrib dependency.
This commit is contained in:
parent
8eafb6b666
commit
75aefa8a0a
13 changed files with 108 additions and 18 deletions
23
pkg/session/session_test.go
Normal file
23
pkg/session/session_test.go
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package session
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/gorilla/sessions"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestGetStore(t *testing.T) {
|
||||
e := echo.New()
|
||||
req := httptest.NewRequest(http.MethodGet, "/", nil)
|
||||
ctx := e.NewContext(req, httptest.NewRecorder())
|
||||
_, err := Get(ctx, "test")
|
||||
assert.Equal(t, ErrStoreNotFound, err)
|
||||
|
||||
Store(ctx, sessions.NewCookieStore([]byte("secret")))
|
||||
_, err = Get(ctx, "test")
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue