FIX: Category latest pages were not preloading properly, causing weird

refreshes when clicking the home logo.
This commit is contained in:
Robin Ward
2014-10-08 12:44:47 -04:00
parent 8a88e71b3c
commit 1f26a79899
5 changed files with 30 additions and 11 deletions

View File

@ -43,7 +43,7 @@ describe TopicQuery do
context 'category filter' do
let(:category) { Fabricate(:category) }
let(:diff_category) { Fabricate(:category) }
let(:diff_category) { Fabricate(:diff_category) }
it "returns topics in the category when we filter to it" do
TopicQuery.new(moderator).list_latest.topics.size.should == 0
@ -51,7 +51,10 @@ describe TopicQuery do
# Filter by slug
TopicQuery.new(moderator, category: category.slug).list_latest.topics.size.should == 1
TopicQuery.new(moderator, category: "#{category.id}-category").list_latest.topics.size.should == 1
TopicQuery.new(moderator, category: diff_category.slug).list_latest.topics.size.should == 1
list = TopicQuery.new(moderator, category: diff_category.slug).list_latest
list.topics.size.should == 1
list.preload_key.should == "topic_list_category/different-category/l/latest"
# Defaults to no category filter when slug does not exist
TopicQuery.new(moderator, category: 'made up slug').list_latest.topics.size.should == 2