(t *testing.T)
| 880 | } |
| 881 | |
| 882 | func TestTopicUpdateSubCnt(t *testing.T) { |
| 883 | // Test RethinkDB specific method |
| 884 | err := adp.TopicUpdateSubCnt(testData.Topics[0].Id) |
| 885 | if err != nil { |
| 886 | t.Fatal(err) |
| 887 | } |
| 888 | |
| 889 | // Verify the subscription count was updated correctly |
| 890 | cursor, err := rdb.Table("topics").Get(testData.Topics[0].Id).Field("SubCnt").Run(conn) |
| 891 | if err != nil { |
| 892 | t.Fatal(err) |
| 893 | } |
| 894 | defer cursor.Close() |
| 895 | |
| 896 | var subcnt int |
| 897 | if err = cursor.One(&subcnt); err != nil { |
| 898 | t.Fatal(err) |
| 899 | } |
| 900 | // Should match the number of active subscriptions |
| 901 | if subcnt < 0 { |
| 902 | t.Error("Subscription count should be non-negative") |
| 903 | } |
| 904 | } |
| 905 | |
| 906 | func TestTopicOwnerChange(t *testing.T) { |
| 907 | err := adp.TopicOwnerChange(testData.Topics[0].Id, types.ParseUserId("usr"+testData.Users[1].Id)) |
nothing calls this directly
no test coverage detected
searching dependent graphs…