refactor: remove pocketbase (#1138)

This commit is contained in:
Jonas Plum
2025-09-02 21:58:08 +02:00
committed by GitHub
parent f28c238135
commit eba2615ec0
435 changed files with 42677 additions and 4730 deletions

29
app/service/http_test.go Normal file
View File

@@ -0,0 +1,29 @@
package service
import (
"errors"
"io"
"net/http"
"net/http/httptest"
"strings"
"testing"
)
func TestJsonError(t *testing.T) {
t.Parallel()
rec := httptest.NewRecorder()
err := errors.New("test error")
r := httptest.NewRequest(http.MethodGet, "/", nil)
jsonError(rec, r, err)
resp := rec.Result()
if resp.StatusCode != http.StatusInternalServerError {
t.Errorf("expected status 500, got %d", resp.StatusCode)
}
body, _ := io.ReadAll(resp.Body)
if !strings.Contains(string(body), "test error") {
t.Errorf("expected error message in body, got %s", string(body))
}
}