reimplement Tag.trending to use old danbooru 1 behavior

This commit is contained in:
r888888888
2013-06-30 15:56:00 -07:00
parent 42e1d4a1e1
commit c61b10cb94
2 changed files with 27 additions and 6 deletions

View File

@@ -14,6 +14,22 @@ class TagTest < ActiveSupport::TestCase
CurrentUser.ip_addr = nil
end
context ".trending" do
setup do
Timecop.travel(1.week.ago) do
Post.create(:tag_string => "aaa")
Post.create(:tag_string => "bbb")
end
Post.create(:tag_string => "bbb")
Post.create(:tag_string => "ccc")
end
should "order the results by the total post count" do
assert_equal([], Tag.trending)
end
end
context "A tag category fetcher" do
setup do
MEMCACHE.flush_all