Support for a new site setting: newuser_spam_host_threshold. If a new user posts a link

to the same host enough tiles, they will not be able to post the same link again.

Additionally, the site will flag all their previous posts with links as spam and they will
be instantly hidden via the auto hide workflow.
This commit is contained in:
Robin Ward
2013-05-10 16:58:23 -04:00
parent 04b8cd5c95
commit d554a59102
19 changed files with 355 additions and 75 deletions

View File

@ -16,7 +16,6 @@ describe Discourse do
end
context 'base_url' do
context 'when ssl is off' do
before do
SiteSetting.expects(:use_ssl?).returns(false)
@ -45,12 +44,26 @@ describe Discourse do
it "returns the non standart port in the base url" do
Discourse.base_url.should == "http://foo.com:3000"
end
end
end
context '#system_user' do
let!(:admin) { Fabricate(:admin) }
let!(:another_admin) { Fabricate(:another_admin) }
it 'returns the user specified by the site setting system_username' do
SiteSetting.stubs(:system_username).returns(another_admin.username)
Discourse.system_user.should == another_admin
end
it 'returns the first admin user otherwise' do
SiteSetting.stubs(:system_username).returns(nil)
Discourse.system_user.should == admin
end
end
end