uploads: make early deletions cost more upload slots.
If a pending post is manually deleted before the 3 day moderation period is up, then make it cost 5 upload slots until the 3 day period is up. This means that if a new user uploads 3 bad posts that get manually deleted, then all of their upload slots will be used and they won't be able to upload again until 3 days have passed.
This commit is contained in:
@@ -17,6 +17,14 @@ class UploadLimitTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
context "a new post that is deleted within the first 3 days" do
|
||||
should "cost the uploader 5 upload slots" do
|
||||
@post = create(:post, uploader: @user, is_deleted: true, created_at: 1.days.ago)
|
||||
|
||||
assert_equal(5, @user.upload_limit.used_upload_slots)
|
||||
end
|
||||
end
|
||||
|
||||
context "a pending post that is approved" do
|
||||
should "increase the uploader's upload points" do
|
||||
@post = create(:post, uploader: @user, is_pending: true, created_at: 7.days.ago)
|
||||
|
||||
Reference in New Issue
Block a user