1
0
forked from baron/baron-sso

test(backend): add unit tests for user group management and fix interface inconsistencies

This commit is contained in:
2026-02-13 14:55:45 +09:00
parent 7f8d52ac3f
commit 92f084fd59
7 changed files with 408 additions and 1 deletions

View File

@@ -57,9 +57,12 @@ func TestKetoService_CreateRelation(t *testing.T) {
func TestKetoService_DeleteRelation(t *testing.T) {
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
assert.Equal(t, "/relation-tuples", r.URL.Path)
assert.Equal(t, "/admin/relation-tuples", r.URL.Path)
assert.Equal(t, "DELETE", r.Method)
assert.Equal(t, "user1", r.URL.Query().Get("subject_id"))
assert.Equal(t, "tenants", r.URL.Query().Get("namespace"))
assert.Equal(t, "tenant1", r.URL.Query().Get("object"))
assert.Equal(t, "admin", r.URL.Query().Get("relation"))
w.WriteHeader(http.StatusNoContent)
})