Send a message to moderators when a newuser_spam_host_threshold is exceeded. Send it no more than once per day per user.

This commit is contained in:
Neil Lalonde
2013-06-10 13:17:09 -04:00
parent 0d83f373b8
commit 9b1d0baf45
7 changed files with 210 additions and 23 deletions

View File

@ -216,11 +216,19 @@ describe PostCreator do
end
it "does not create the post" do
GroupMessage.stubs(:create)
creator.create
creator.errors.should be_present
creator.spam?.should be_true
end
it "sends a message to moderators" do
GroupMessage.expects(:create).with do |group_name, msg_type, params|
group_name == Group[:moderators].name and msg_type == :spam_post_blocked and params[:user].id == user.id
end
creator.create
end
end
# more integration testing ... maximise our testing