Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1

Этот коммит содержится в:
Martin Kraft
2018-03-27 09:01:42 -04:00
родитель d8b4207018 9e6db178b0
Коммит e13e64711f
42 изменённых файлов: 1028 добавлений и 193 удалений

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

@@ -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
}

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

@@ -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))
}