oficina / meet Public

Clone
git clone https://amadan.net/oficina/meet

Plain git — no account needed to clone.

Download

Download this file

1package callstest
2
3import (
4 "testing"
5
6 "amadan.net/oficina/calls/internal/calls"
7)
8
9func TestBootCreatesEveryTable(t *testing.T) {
10 d := openDB(t)
11 _, rt, err := calls.App(testCtx(t), d, calls.Config{Env: calls.EnvDevelopment})
12 if err != nil {
13 t.Fatal(err)
14 }
15 t.Cleanup(rt.Close)
16 for _, table := range []string{"persons", "meetings", "meeting_links", "guest_grants", "pending_joins", "sessions", "auth_links"} {
17 var n int
18 if err := d.G.Raw("SELECT count(*) FROM sqlite_master WHERE type='table' AND name=?", table).Scan(&n).Error; err != nil {
19 t.Fatal(err)
20 }
21 if n != 1 {
22 t.Errorf("table %s missing after boot", table)
23 }
24 }
25}
26