mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
reorganize site settings a bit
This commit is contained in:
@ -118,7 +118,7 @@ describe TopicView do
|
||||
end
|
||||
|
||||
it "generates a canonical correctly for paged results" do
|
||||
SiteSetting.stubs(:posts_per_page).returns(5)
|
||||
SiteSetting.stubs(:posts_chunksize).returns(5)
|
||||
TopicView.new(1234, user, post_number: 50).canonical_path.should eql("/1234?page=10")
|
||||
end
|
||||
end
|
||||
@ -136,7 +136,7 @@ describe TopicView do
|
||||
TopicView.any_instance.expects(:find_topic).with(1234).returns(topic)
|
||||
TopicView.any_instance.stubs(:filter_posts)
|
||||
TopicView.any_instance.stubs(:last_post).returns(p2)
|
||||
SiteSetting.stubs(:posts_per_page).returns(2)
|
||||
SiteSetting.stubs(:posts_chunksize).returns(2)
|
||||
end
|
||||
|
||||
it "should return the next page" do
|
||||
@ -245,7 +245,7 @@ describe TopicView do
|
||||
let!(:p3) { Fabricate(:post, topic: topic, user: first_poster)}
|
||||
|
||||
before do
|
||||
SiteSetting.posts_per_page = 3
|
||||
SiteSetting.posts_chunksize = 3
|
||||
|
||||
# Update them to the sort order we're checking for
|
||||
[p1, p2, p3, p4, p5, p6, p7].each_with_index do |p, idx|
|
||||
@ -289,7 +289,7 @@ describe TopicView do
|
||||
|
||||
|
||||
describe '#filter_posts_paged' do
|
||||
before { SiteSetting.stubs(:posts_per_page).returns(2) }
|
||||
before { SiteSetting.stubs(:posts_chunksize).returns(2) }
|
||||
|
||||
it 'returns correct posts for all pages' do
|
||||
topic_view.filter_posts_paged(1).should == [p1, p2]
|
||||
@ -362,7 +362,7 @@ describe TopicView do
|
||||
end
|
||||
|
||||
context "when 'posts per page' exceeds the number of posts" do
|
||||
before { SiteSetting.stubs(:posts_per_page).returns(100) }
|
||||
before { SiteSetting.stubs(:posts_chunksize).returns(100) }
|
||||
|
||||
it 'returns all the posts' do
|
||||
near_view = topic_view_near(p5)
|
||||
|
Reference in New Issue
Block a user