FIX: consider staged users mature (no spam checks) after 1 day

This commit is contained in:
Jeff Wong 2018-06-19 09:41:10 -07:00
parent 2f7a8ed86c
commit 2ff226e509
2 changed files with 4 additions and 4 deletions

View File

@ -1075,7 +1075,7 @@ class User < ActiveRecord::Base
end
def mature_staged?
from_staged? && self.created_at && self.created_at < 1.week.ago
from_staged? && self.created_at && self.created_at < 1.day.ago
end
protected

View File

@ -967,7 +967,7 @@ describe Post do
expect(post.has_host_spam?).to eq(false)
end
it "punishes previously staged users that were created within 1 week" do
it "punishes previously staged users that were created within 1 day" do
SiteSetting.newuser_spam_host_threshold = 1
SiteSetting.newuser_max_links = 3
user = Fabricate(:user, staged: true, trust_level: 0)
@ -977,11 +977,11 @@ describe Post do
expect(post.has_host_spam?).to eq(true)
end
it "doesn't punish previously staged users over 1 week old" do
it "doesn't punish previously staged users over 1 day old" do
SiteSetting.newuser_spam_host_threshold = 1
SiteSetting.newuser_max_links = 3
user = Fabricate(:user, staged: true, trust_level: 0)
user.created_at = 1.week.ago
user.created_at = 1.day.ago
user.unstage
post = Fabricate(:post, raw: raw, user: user)
expect(post.has_host_spam?).to eq(false)