FEATURE: post chunk size should not be configurable

If people need to configure post chunk size use a plugin
Core only supports out of the box settings, if changed can lead to
severe performance issues.
This commit is contained in:
Sam
2014-12-15 10:57:34 +11:00
parent 2eb47f8125
commit ae16186100
14 changed files with 20 additions and 31 deletions

View File

@ -656,19 +656,16 @@ describe TopicsController do
context 'filters' do
it 'grabs first page when no filter is provided' do
SiteSetting.stubs(:posts_chunksize).returns(20)
TopicView.any_instance.expects(:filter_posts_in_range).with(0, 19)
xhr :get, :show, topic_id: topic.id, slug: topic.slug
end
it 'grabs first page when first page is provided' do
SiteSetting.stubs(:posts_chunksize).returns(20)
TopicView.any_instance.expects(:filter_posts_in_range).with(0, 19)
xhr :get, :show, topic_id: topic.id, slug: topic.slug, page: 1
end
it 'grabs correct range when a page number is provided' do
SiteSetting.stubs(:posts_chunksize).returns(20)
TopicView.any_instance.expects(:filter_posts_in_range).with(20, 39)
xhr :get, :show, topic_id: topic.id, slug: topic.slug, page: 2
end