mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Use a fixed limit for mega topic posts count.
This commit is contained in:
@@ -565,13 +565,20 @@ describe TopicView do
|
||||
|
||||
describe 'for mega topics' do
|
||||
it 'should return the right columns' do
|
||||
SiteSetting.auto_close_topics_post_count = 2
|
||||
begin
|
||||
original_const = TopicView::MEGA_TOPIC_POSTS_COUNT
|
||||
TopicView.send(:remove_const, "MEGA_TOPIC_POSTS_COUNT")
|
||||
TopicView.const_set("MEGA_TOPIC_POSTS_COUNT", 2)
|
||||
|
||||
expect(topic_view.filtered_post_stream).to eq([
|
||||
[post.id, post.post_number],
|
||||
[post2.id, post2.post_number],
|
||||
[post3.id, post3.post_number]
|
||||
])
|
||||
expect(topic_view.filtered_post_stream).to eq([
|
||||
[post.id, post.post_number],
|
||||
[post2.id, post2.post_number],
|
||||
[post3.id, post3.post_number]
|
||||
])
|
||||
ensure
|
||||
TopicView.send(:remove_const, "MEGA_TOPIC_POSTS_COUNT")
|
||||
TopicView.const_set("MEGA_TOPIC_POSTS_COUNT", original_const)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user