FIX: Next pages were missing on <noscript> content. Also fixed some long standing bugs.

This commit is contained in:
Robin Ward
2013-07-05 14:45:54 -04:00
parent 2e7eee7ebd
commit 4c90b16681
3 changed files with 23 additions and 14 deletions

View File

@ -497,19 +497,19 @@ describe TopicsController do
it 'grabs first page when no filter is provided' do
SiteSetting.stubs(:posts_per_page).returns(20)
TopicView.any_instance.expects(:filter_posts_in_range).with(0, 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_per_page).returns(20)
TopicView.any_instance.expects(:filter_posts_in_range).with(0, 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_per_page).returns(20)
TopicView.any_instance.expects(:filter_posts_in_range).with(20, 40)
TopicView.any_instance.expects(:filter_posts_in_range).with(20, 39)
xhr :get, :show, topic_id: topic.id, slug: topic.slug, page: 2
end