feat: setting up routes for spaces landing page

This commit is contained in:
juancwu 2026-04-07 12:38:07 +00:00
commit 7c375e1002
8 changed files with 94 additions and 12 deletions

View 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"))
}