grab highest post number from the raw data, so deletions at the end of a topic work

This commit is contained in:
Sam Saffron
2013-02-15 12:58:14 +11:00
parent 9eb5c2a66a
commit a8085f15c4
3 changed files with 19 additions and 4 deletions

View File

@@ -106,10 +106,12 @@ describe TopicView do
end
it 'allows admins to see deleted posts' do
post_number = p3.post_number
p3.destroy
admin = Fabricate(:admin)
topic_view = TopicView.new(topic.id, admin)
topic_view.posts.count.should == 3
topic_view.highest_post_number.should == post_number
end
it 'does not allow non admins to see deleted posts' do
@@ -117,7 +119,7 @@ describe TopicView do
topic_view.posts.count.should == 2
end
# Sam: disabled for now, we only need this for poss, if we do, roll it into topic
# Sam: disabled for now, we only need this for polls, if we do, roll it into topic
# having to walk every post action is not really a good idea
#
# context '.voted_in_topic?' do