Fix #4680: @-ing yourself sends you a DMail.
Don't send a dmail when the user @-mentions themselves, whether in an edit or in the original message.
This commit is contained in:
@@ -60,6 +60,12 @@ class ForumPostTest < ActiveSupport::TestCase
|
||||
EOS
|
||||
end
|
||||
end
|
||||
|
||||
should "not send a mention to yourself" do
|
||||
assert_no_difference("Dmail.count") do
|
||||
@forum_post = as(@user) { create(:forum_post, body: "hi from @#{@user.name}") }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "that belongs to a topic with several pages of posts" do
|
||||
|
||||
Reference in New Issue
Block a user