(t *testing.T)
| 926 | } |
| 927 | |
| 928 | func TestSubsUpdate(t *testing.T) { |
| 929 | update := map[string]any{ |
| 930 | "UpdatedAt": testData.Now.Add(22 * time.Minute), |
| 931 | } |
| 932 | err := adp.SubsUpdate(testData.Topics[0].Id, types.ParseUserId("usr"+testData.Users[0].Id), update) |
| 933 | if err != nil { |
| 934 | t.Fatal(err) |
| 935 | } |
| 936 | |
| 937 | cursor, err := rdb.Table("subscriptions").Get(testData.Topics[0].Id + ":" + testData.Users[0].Id). |
| 938 | Field("UpdatedAt").Run(conn) |
| 939 | if err != nil { |
| 940 | t.Fatal(err) |
| 941 | } |
| 942 | defer cursor.Close() |
| 943 | |
| 944 | var got time.Time |
| 945 | if err = cursor.One(&got); err != nil { |
| 946 | t.Fatal(err) |
| 947 | } |
| 948 | if !got.Equal(update["UpdatedAt"].(time.Time)) { |
| 949 | t.Error(mismatchErrorString("UpdatedAt", got, update["UpdatedAt"])) |
| 950 | } |
| 951 | |
| 952 | err = adp.SubsUpdate(testData.Topics[1].Id, types.ZeroUid, update) |
| 953 | if err != nil { |
| 954 | t.Fatal(err) |
| 955 | } |
| 956 | |
| 957 | cursor2, err := rdb.Table("subscriptions").GetAllByIndex("Topic", testData.Topics[1].Id). |
| 958 | Field("UpdatedAt").Limit(1).Run(conn) |
| 959 | if err != nil { |
| 960 | t.Fatal(err) |
| 961 | } |
| 962 | defer cursor2.Close() |
| 963 | |
| 964 | if err = cursor2.One(&got); err != nil { |
| 965 | t.Fatal(err) |
| 966 | } |
| 967 | if !got.Equal(update["UpdatedAt"].(time.Time)) { |
| 968 | t.Error(mismatchErrorString("UpdatedAt", got, update["UpdatedAt"])) |
| 969 | } |
| 970 | } |
| 971 | |
| 972 | func TestSubsDelete(t *testing.T) { |
| 973 | err := adp.SubsDelete(testData.Topics[1].Id, types.ParseUserId("usr"+testData.Users[0].Id)) |
nothing calls this directly
no test coverage detected
searching dependent graphs…