This commit is contained in:
@@ -334,6 +334,22 @@ func TestPostReplyNotifications(t *testing.T) {
|
||||
t.Fatalf("homeowner reply notification = %+v", msg)
|
||||
}
|
||||
|
||||
rec = postForm(handler, "/posts", url.Values{
|
||||
"_csrf": {adminCSRF},
|
||||
"parent_id": {adminReply.ID},
|
||||
"body": {"One more plumber detail."},
|
||||
}, adminCookies)
|
||||
if rec.Code != http.StatusSeeOther {
|
||||
t.Fatalf("nested admin reply status = %d: %s", rec.Code, rec.Body.String())
|
||||
}
|
||||
msgs = waitForMail(t, recording, 3)
|
||||
if msg := msgs[2]; msg.ToEmail != homeowner.Email ||
|
||||
msg.RootID != root.ID ||
|
||||
msg.ReplyBody != "One more plumber detail." ||
|
||||
msg.ReplyAuthorName != admin.Name {
|
||||
t.Fatalf("nested admin reply notification = %+v", msg)
|
||||
}
|
||||
|
||||
rec = postForm(handler, "/posts", url.Values{
|
||||
"_csrf": {homeownerCSRF},
|
||||
"parent_id": {root.ID},
|
||||
@@ -376,7 +392,7 @@ func TestPostReplyNotifications(t *testing.T) {
|
||||
t.Fatalf("no-email reply status = %d: %s", rec.Code, rec.Body.String())
|
||||
}
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
if recording.Len() != 2 {
|
||||
if recording.Len() != 3 {
|
||||
t.Fatalf("self, edit, or no-email action sent a notification: %+v", recording.Snapshot())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user