Skip to content

Commit 81c68f8

Browse files
committed
Fix test_remove_member_bcc
1 parent c5dbce4 commit 81c68f8

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/mimefactory.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2546,8 +2546,9 @@ mod tests {
25462546
// Alice creates a group with Bob and Claire and then removes Bob.
25472547
let alice = TestContext::new_alice().await;
25482548

2549+
let claire_addr = "claire@foo.de";
25492550
let bob_id = Contact::create(&alice, "Bob", "bob@example.net").await?;
2550-
let claire_id = Contact::create(&alice, "Claire", "claire@foo.de").await?;
2551+
let claire_id = Contact::create(&alice, "Claire", claire_addr).await?;
25512552

25522553
let alice_chat_id = create_group_chat(&alice, ProtectionStatus::Unprotected, "foo").await?;
25532554
add_contact_to_chat(&alice, alice_chat_id, bob_id).await?;
@@ -2563,10 +2564,17 @@ mod tests {
25632564
.get_first_header("To")
25642565
.context("no To: header parsed")?;
25652566
let to = addrparse_header(to)?;
2566-
let mailbox = to
2567-
.extract_single_info()
2568-
.context("to: field does not contain exactly one address")?;
2569-
assert_eq!(mailbox.addr, "bob@example.net");
2567+
for to_addr in to.iter() {
2568+
match to_addr {
2569+
mailparse::MailAddr::Single(ref info) => {
2570+
// Addresses should be of existing members (Alice and Bob) and not Claire.
2571+
assert_ne!(info.addr, claire_addr);
2572+
}
2573+
mailparse::MailAddr::Group(_) => {
2574+
panic!("Group addresses are not expected here");
2575+
}
2576+
}
2577+
}
25702578

25712579
Ok(())
25722580
}

0 commit comments

Comments
 (0)