Skip to content

Commit 5445310

Browse files
committed
test: Auto-generated non-chat message is non-bot
1 parent 740bd7a commit 5445310

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/message.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2752,6 +2752,25 @@ mod tests {
27522752
let contact = Contact::get_by_id(&alice, msg.from_id).await?;
27532753
assert!(!contact.is_bot());
27542754

2755+
// Alice receives an auto-generated non-chat message.
2756+
receive_imf(
2757+
&alice,
2758+
b"From: Claire <[email protected]>\n\
2759+
2760+
Message-ID: <[email protected]>\n\
2761+
Auto-Submitted: auto-generated\n\
2762+
Date: Fri, 29 Jan 2021 21:37:55 +0000\n\
2763+
\n\
2764+
hello\n",
2765+
false,
2766+
)
2767+
.await?;
2768+
let msg = alice.get_last_msg().await;
2769+
assert_eq!(msg.get_text(), "hello".to_string());
2770+
assert!(!msg.is_bot());
2771+
let contact = Contact::get_by_id(&alice, msg.from_id).await?;
2772+
assert!(!contact.is_bot());
2773+
27552774
Ok(())
27562775
}
27572776

0 commit comments

Comments
 (0)