MCPcopy
hub / github.com/tinode/chat / TestTopicOwnerChange

Function TestTopicOwnerChange

server/db/rethinkdb/tests/rethink_test.go:906–926  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

904}
905
906func TestTopicOwnerChange(t *testing.T) {
907 err := adp.TopicOwnerChange(testData.Topics[0].Id, types.ParseUserId("usr"+testData.Users[1].Id))
908 if err != nil {
909 t.Fatal(err)
910 }
911
912 cursor, err := rdb.Table("topics").Get(testData.Topics[0].Id).Field("Owner").Run(conn)
913 if err != nil {
914 t.Fatal(err)
915 }
916 defer cursor.Close()
917
918 var got string
919 if err = cursor.One(&got); err != nil {
920 t.Fatal(err)
921 }
922
923 if got != testData.Users[1].Id {
924 t.Error(mismatchErrorString("Owner", got, testData.Users[1].Id))
925 }
926}
927
928func TestSubsUpdate(t *testing.T) {
929 update := map[string]any{

Callers

nothing calls this directly

Calls 6

ParseUserIdFunction · 0.92
ErrorMethod · 0.80
mismatchErrorStringFunction · 0.70
TopicOwnerChangeMethod · 0.65
GetMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…