naive implementation of post_count on categories

This commit is contained in:
Sam
2013-10-18 11:10:10 +11:00
parent 9ad01a1afb
commit 7bf96ee690
4 changed files with 39 additions and 6 deletions
+3 -1
View File
@@ -255,7 +255,7 @@ describe Category do
context 'with regular topics' do
before do
@category.topics << Fabricate(:topic, user: @category.user)
create_post(user: @category.user, category: @category.name)
Category.update_stats
@category.reload
end
@@ -265,6 +265,7 @@ describe Category do
@category.topics_month.should == 1
@category.topics_year.should == 1
@category.topic_count.should == 1
@category.post_count.should == 1
end
end
@@ -282,6 +283,7 @@ describe Category do
@category.topic_count.should == 0
@category.topics_month.should == 0
@category.topics_year.should == 0
@category.post_count.should == 0
end
end