mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
We never want to filter TopicView to just one post.
This commit is contained in:
parent
69c7b5aeed
commit
27a07054d7
2 changed files with 16 additions and 30 deletions
|
@ -167,29 +167,24 @@ describe TopicView do
|
|||
context '.posts' do
|
||||
context 'near a post_number' do
|
||||
|
||||
context 'with a valid post_number' do
|
||||
before do
|
||||
topic.reload
|
||||
topic_view.filter_posts_near(p2.post_number)
|
||||
end
|
||||
let (:near_topic_view) { TopicView.new(topic.id, coding_horror, post_number: p2.post_number) }
|
||||
|
||||
it 'returns posts around a post number' do
|
||||
topic_view.posts.should == [p1, p2, p3]
|
||||
end
|
||||
|
||||
it 'has a min of the 1st post number' do
|
||||
topic_view.min.should == p1.post_number
|
||||
end
|
||||
|
||||
it 'has a max of the 3rd post number' do
|
||||
topic_view.max.should == p3.post_number
|
||||
end
|
||||
|
||||
it 'is the inital load' do
|
||||
topic_view.should be_initial_load
|
||||
end
|
||||
it 'returns posts around a post number' do
|
||||
near_topic_view.posts.should == [p1, p2, p3]
|
||||
end
|
||||
|
||||
it 'has a min of the 1st post number' do
|
||||
near_topic_view.min.should == p1.post_number
|
||||
end
|
||||
|
||||
it 'has a max of the 3rd post number' do
|
||||
near_topic_view.max.should == p3.post_number
|
||||
end
|
||||
|
||||
it 'is the inital load' do
|
||||
near_topic_view.should be_initial_load
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context 'before a post_number' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue