diff options
author | Martin Kraft <martinkraft@gmail.com> | 2018-03-27 09:01:42 -0400 |
---|---|---|
committer | Martin Kraft <martinkraft@gmail.com> | 2018-03-27 09:01:42 -0400 |
commit | e13e64711f7a7e8ceadb8cbc6af72c4022c95b36 (patch) | |
tree | fe0e956b1d660cd08d41757d25c8adcb3463568c /store/storetest | |
parent | d8b42070186c12f6320fe54ea1c405149846404c (diff) | |
parent | 9e6db178b09387e21ac19ce85369cf1ca7a443e8 (diff) | |
download | chat-e13e64711f7a7e8ceadb8cbc6af72c4022c95b36.tar.gz chat-e13e64711f7a7e8ceadb8cbc6af72c4022c95b36.tar.bz2 chat-e13e64711f7a7e8ceadb8cbc6af72c4022c95b36.zip |
Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1
Diffstat (limited to 'store/storetest')
-rw-r--r-- | store/storetest/mocks/PostStore.go | 15 | ||||
-rw-r--r-- | store/storetest/post_store.go | 6 |
2 files changed, 21 insertions, 0 deletions
diff --git a/store/storetest/mocks/PostStore.go b/store/storetest/mocks/PostStore.go index c405d5030..bdd0d1d16 100644 --- a/store/storetest/mocks/PostStore.go +++ b/store/storetest/mocks/PostStore.go @@ -422,3 +422,18 @@ func (_m *PostStore) Update(newPost *model.Post, oldPost *model.Post) store.Stor return r0 } + +func (_m *PostStore) GetMaxPostSize() store.StoreChannel { + ret := _m.Called() + + var r0 store.StoreChannel + if rf, ok := ret.Get(0).(func() store.StoreChannel); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(store.StoreChannel) + } + } + + return r0 +} diff --git a/store/storetest/post_store.go b/store/storetest/post_store.go index 91fc40213..44ce47d9d 100644 --- a/store/storetest/post_store.go +++ b/store/storetest/post_store.go @@ -43,6 +43,7 @@ func TestPostStore(t *testing.T, ss store.Store) { t.Run("GetPostsBatchForIndexing", func(t *testing.T) { testPostStoreGetPostsBatchForIndexing(t, ss) }) t.Run("PermanentDeleteBatch", func(t *testing.T) { testPostStorePermanentDeleteBatch(t, ss) }) t.Run("GetOldest", func(t *testing.T) { testPostStoreGetOldest(t, ss) }) + t.Run("TestGetMaxPostSize", func(t *testing.T) { testGetMaxPostSize(t, ss) }) } func testPostStoreSave(t *testing.T, ss store.Store) { @@ -1783,3 +1784,8 @@ func testPostStoreGetOldest(t *testing.T, ss store.Store) { assert.EqualValues(t, o2.Id, r1.Id) } + +func testGetMaxPostSize(t *testing.T, ss store.Store) { + assert.Equal(t, model.POST_MESSAGE_MAX_RUNES_V2, (<-ss.Post().GetMaxPostSize()).Data.(int)) + assert.Equal(t, model.POST_MESSAGE_MAX_RUNES_V2, (<-ss.Post().GetMaxPostSize()).Data.(int)) +} |