mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 23:31:18 +08:00
FEATURE: support for mandrill webhooks
This commit is contained in:
@ -75,4 +75,28 @@ describe WebhooksController do
|
||||
|
||||
end
|
||||
|
||||
context "mandrill" do
|
||||
|
||||
it "works" do
|
||||
user = Fabricate(:user, email: email)
|
||||
email_log = Fabricate(:email_log, user: user, message_id: message_id)
|
||||
|
||||
post :mandrill, mandrill_events: [{
|
||||
"event" => "hard_bounce",
|
||||
"msg" => {
|
||||
"metadata" => {
|
||||
"message_id" => message_id
|
||||
}
|
||||
}
|
||||
}]
|
||||
|
||||
expect(response).to be_success
|
||||
|
||||
email_log.reload
|
||||
expect(email_log.bounced).to eq(true)
|
||||
expect(email_log.user.user_stat.bounce_score).to eq(2)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user