Added ChannelExtra.MemberCount field to reflect the actual member count when we truncate the list of members to 20

Этот коммит содержится в:
hmhealey
2015-11-12 11:25:46 -05:00
родитель 13a251a5ee
Коммит be43522117
8 изменённых файлов: 45 добавлений и 10 удалений

Просмотреть файл

@@ -339,15 +339,15 @@ func TestChannelMemberStore(t *testing.T) {
t.Fatal("Member update time incorrect")
}
members := (<-store.Channel().GetMembers(o1.ChannelId)).Data.([]model.ChannelMember)
if len(members) != 2 {
count := (<-store.Channel().GetMemberCount(o1.ChannelId)).Data.(int64)
if count != 2 {
t.Fatal("should have saved 2 members")
}
Must(store.Channel().RemoveMember(o2.ChannelId, o2.UserId))
members = (<-store.Channel().GetMembers(o1.ChannelId)).Data.([]model.ChannelMember)
if len(members) != 1 {
count = (<-store.Channel().GetMemberCount(o1.ChannelId)).Data.(int64)
if count != 1 {
t.Fatal("should have removed 1 member")
}