mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FEATURE: support for mandrill webhooks
This commit is contained in:
parent
95a013784f
commit
49f8a2baa7
4 changed files with 47 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue