mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: uncategorized counts were always 0. topics_year, topics_month, topics_week, topics_day
This commit is contained in:
@@ -380,6 +380,26 @@ describe Category do
|
||||
@category.posts_week.should == 1
|
||||
end
|
||||
end
|
||||
|
||||
context 'for uncategorized category' do
|
||||
before do
|
||||
@uncategorized = Category.find(SiteSetting.uncategorized_category_id)
|
||||
create_post(user: Fabricate(:user), category: @uncategorized.name)
|
||||
Category.update_stats
|
||||
@uncategorized.reload
|
||||
end
|
||||
|
||||
it 'updates topic stats' do
|
||||
@uncategorized.topics_week.should == 1
|
||||
@uncategorized.topics_month.should == 1
|
||||
@uncategorized.topics_year.should == 1
|
||||
@uncategorized.topic_count.should == 1
|
||||
@uncategorized.post_count.should == 1
|
||||
@uncategorized.posts_year.should == 1
|
||||
@uncategorized.posts_month.should == 1
|
||||
@uncategorized.posts_week.should == 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "#url" do
|
||||
|
||||
Reference in New Issue
Block a user