mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user