mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:21:18 +08:00
FEATURE: automatic PM when a user's email is revoked
This commit is contained in:
@ -129,6 +129,17 @@ describe Email::Receiver do
|
||||
expect(email_log_2.bounced).to eq(true)
|
||||
end
|
||||
|
||||
it "sends a system message once they reach the 'bounce_score_threshold'" do
|
||||
expect(user.active).to eq(true)
|
||||
|
||||
user.user_stat.bounce_score = SiteSetting.bounce_score_threshold - 1
|
||||
user.user_stat.save!
|
||||
|
||||
SystemMessage.expects(:create_from_system_user).with(user, :email_revoked)
|
||||
|
||||
expect { process(:hard_bounce_via_verp) }.to raise_error(Email::Receiver::BouncedEmailError)
|
||||
end
|
||||
|
||||
it "automatically deactive users once they reach the 'bounce_score_threshold_deactivate' threshold" do
|
||||
expect(user.active).to eq(true)
|
||||
|
||||
|
Reference in New Issue
Block a user