diff options
author | Martin Kraft <martinkraft@gmail.com> | 2018-05-24 08:40:52 -0400 |
---|---|---|
committer | Martin Kraft <martinkraft@gmail.com> | 2018-05-24 08:40:52 -0400 |
commit | 69304fb54da5300941a49364e4344c2c65e654d6 (patch) | |
tree | de20c2e8a479ae3d13bcd21abc3dff067afa602e /store | |
parent | e46b94fa66c029b9a493fdc6ff7bcb98e9651568 (diff) | |
parent | 47f3c064db885c2cb2e75c195ea24e2ef687891d (diff) | |
download | chat-69304fb54da5300941a49364e4344c2c65e654d6.tar.gz chat-69304fb54da5300941a49364e4344c2c65e654d6.tar.bz2 chat-69304fb54da5300941a49364e4344c2c65e654d6.zip |
Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2
Diffstat (limited to 'store')
-rw-r--r-- | store/storetest/channel_store.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/store/storetest/channel_store.go b/store/storetest/channel_store.go index 7e0a2d552..eea79d42f 100644 --- a/store/storetest/channel_store.go +++ b/store/storetest/channel_store.go @@ -720,6 +720,9 @@ func testChannelMemberStore(t *testing.T, ss store.Store) { c1.Type = model.CHANNEL_OPEN c1 = *store.Must(ss.Channel().Save(&c1, -1)).(*model.Channel) + c1t1 := (<-ss.Channel().Get(c1.Id, false)).Data.(*model.Channel) + assert.EqualValues(t, 0, c1t1.ExtraUpdateAt, "ExtraUpdateAt should be 0") + u1 := model.User{} u1.Email = model.NewId() u1.Nickname = model.NewId() @@ -744,6 +747,9 @@ func testChannelMemberStore(t *testing.T, ss store.Store) { o2.NotifyProps = model.GetDefaultChannelNotifyProps() store.Must(ss.Channel().SaveMember(&o2)) + c1t2 := (<-ss.Channel().Get(c1.Id, false)).Data.(*model.Channel) + assert.EqualValues(t, 0, c1t2.ExtraUpdateAt, "ExtraUpdateAt should be 0") + count := (<-ss.Channel().GetMemberCount(o1.ChannelId, true)).Data.(int64) if count != 2 { t.Fatal("should have saved 2 members") @@ -774,6 +780,9 @@ func testChannelMemberStore(t *testing.T, ss store.Store) { t.Fatal("should have removed 1 member") } + c1t3 := (<-ss.Channel().Get(c1.Id, false)).Data.(*model.Channel) + assert.EqualValues(t, 0, c1t3.ExtraUpdateAt, "ExtraUpdateAt should be 0") + member := (<-ss.Channel().GetMember(o1.ChannelId, o1.UserId)).Data.(*model.ChannelMember) if member.ChannelId != o1.ChannelId { t.Fatal("should have go member") @@ -782,6 +791,9 @@ func testChannelMemberStore(t *testing.T, ss store.Store) { if err := (<-ss.Channel().SaveMember(&o1)).Err; err == nil { t.Fatal("Should have been a duplicate") } + + c1t4 := (<-ss.Channel().Get(c1.Id, false)).Data.(*model.Channel) + assert.EqualValues(t, 0, c1t4.ExtraUpdateAt, "ExtraUpdateAt should be 0") } func testChannelDeleteMemberStore(t *testing.T, ss store.Store) { @@ -792,6 +804,9 @@ func testChannelDeleteMemberStore(t *testing.T, ss store.Store) { c1.Type = model.CHANNEL_OPEN c1 = *store.Must(ss.Channel().Save(&c1, -1)).(*model.Channel) + c1t1 := (<-ss.Channel().Get(c1.Id, false)).Data.(*model.Channel) + assert.EqualValues(t, 0, c1t1.ExtraUpdateAt, "ExtraUpdateAt should be 0") + u1 := model.User{} u1.Email = model.NewId() u1.Nickname = model.NewId() @@ -816,6 +831,9 @@ func testChannelDeleteMemberStore(t *testing.T, ss store.Store) { o2.NotifyProps = model.GetDefaultChannelNotifyProps() store.Must(ss.Channel().SaveMember(&o2)) + c1t2 := (<-ss.Channel().Get(c1.Id, false)).Data.(*model.Channel) + assert.EqualValues(t, 0, c1t2.ExtraUpdateAt, "ExtraUpdateAt should be 0") + count := (<-ss.Channel().GetMemberCount(o1.ChannelId, false)).Data.(int64) if count != 2 { t.Fatal("should have saved 2 members") |