Skip to content

A platform for community discussion. Free, open, simple.

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

Jeff Wong2ff226e5091f
diff --git a/app/models/user.rb b/app/models/user.rb
index e389a4ea4ce..f4a751f904b 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -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
diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb
index 8f91e618318..78c8d237936 100644
--- a/spec/models/post_spec.rb
+++ b/spec/models/post_spec.rb
@@ -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)