mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: don't invite users with emails configured as 'incoming' (reply, group our category)
This commit is contained in:
@ -229,11 +229,11 @@ describe Email::Receiver do
|
||||
expect(user.name).to eq("Случайная Имя")
|
||||
end
|
||||
|
||||
it "invites everyone in the chain but users whose email matches the 'reply_by_email_address'" do
|
||||
it "invites everyone in the chain but emails configured as 'incoming' (via reply, group or category)" do
|
||||
expect { process(:cc) }.to change(Topic, :count)
|
||||
emails = Topic.last.allowed_users.pluck(:email)
|
||||
expect(emails.size).to eq(4)
|
||||
expect(emails).to include("someone@else.com", "discourse@bar.com", "team@bar.com", "wat@bar.com")
|
||||
expect(emails.size).to eq(3)
|
||||
expect(emails).to include("someone@else.com", "discourse@bar.com", "wat@bar.com")
|
||||
end
|
||||
|
||||
it "associates email replies using both 'In-Reply-To' and 'References' headers" do
|
||||
@ -244,11 +244,11 @@ describe Email::Receiver do
|
||||
expect { process(:email_reply_2) }.to change { topic.posts.count }
|
||||
expect { process(:email_reply_3) }.to change { topic.posts.count }
|
||||
|
||||
# Why 6 when we only processed 3 emails?
|
||||
# Why 5 when we only processed 3 emails?
|
||||
# - 3 of them are indeed "regular" posts generated from the emails
|
||||
# - The 3 others are "small action" posts automatically added because
|
||||
# we invited 3 users (team@bar.com, two@foo.com and three@foo.com)
|
||||
expect(topic.posts.count).to eq(6)
|
||||
# - The 2 others are "small action" posts automatically added because
|
||||
# we invited 2 users (two@foo.com and three@foo.com)
|
||||
expect(topic.posts.count).to eq(5)
|
||||
|
||||
# trash all but the 1st post
|
||||
topic.ordered_posts[1..-1].each(&:trash!)
|
||||
|
Reference in New Issue
Block a user