feat: setting up routes for spaces landing page
This commit is contained in:
parent
36a3d6f962
commit
7c375e1002
8 changed files with 94 additions and 12 deletions
21
internal/handler/redirect_test.go
Normal file
21
internal/handler/redirect_test.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"git.juancwu.dev/juancwu/budgit/internal/testutil"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestRedirectHandler_RederictToSpaces(t *testing.T) {
|
||||
h := NewRedirectHandler()
|
||||
|
||||
req := testutil.NewRequest(t, http.MethodPost, "/app/dashboard", nil)
|
||||
w := httptest.NewRecorder()
|
||||
h.Spaces(w, req)
|
||||
|
||||
assert.Equal(t, http.StatusMovedPermanently, w.Code)
|
||||
assert.Equal(t, "/app/spaces", w.Header().Get("Location"))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue