Move Curated pool updater to Danbooru.
* Move the Curated pool updater from Reportbooru to Danbooru. * Change the process for selecting curated posts. Previously it was every post from the last week with at least three supervotes. This was flawed because it included both super-upvotes and super-downvotes. Now it's the top 100 posts from the last week, ordered from most super-upvoted to least.
This commit is contained in:
@@ -3,13 +3,20 @@ require 'test_helper'
|
||||
class DanbooruMaintenanceTest < ActiveSupport::TestCase
|
||||
context "daily maintenance" do
|
||||
setup do
|
||||
FactoryBot.create(:admin_user) # for SuperVoter.init!
|
||||
@admin = create(:admin_user) # for SuperVoter.init!
|
||||
end
|
||||
|
||||
should "work" do
|
||||
assert_nothing_raised { DanbooruMaintenance.daily }
|
||||
end
|
||||
|
||||
should "update the curated pool" do
|
||||
pool = as(@admin) { create(:pool, name: "curated") }
|
||||
Danbooru.config.stubs(:curated_pool_id).returns(pool.id)
|
||||
|
||||
assert_nothing_raised { DanbooruMaintenance.daily }
|
||||
end
|
||||
|
||||
should "prune expired posts" do
|
||||
@pending = FactoryBot.create(:post, is_pending: true, created_at: 4.days.ago)
|
||||
@flagged = FactoryBot.create(:post, is_flagged: true, created_at: 4.days.ago)
|
||||
|
||||
Reference in New Issue
Block a user