mentions: include mentioner in subject line.

The template looks like this:

Subject:

    #{creator_name} mentioned you in a comment on post ##{post_id}

Body:

    @#{creator_name} mentioned you in a \"comment\":/posts/#{post_id}#comment-#{id} on post ##{post_id}:

    [quote]
    #{DText.excerpt(body, "@"+user_name)}
    [/quote]
This commit is contained in:
evazion
2017-02-25 22:28:21 -06:00
parent 6994231801
commit 46280f2227
6 changed files with 31 additions and 12 deletions

View File

@@ -57,7 +57,13 @@ class CommentTest < ActiveSupport::TestCase
end
dmail = Dmail.last
assert_equal("You were mentioned in a \"comment\":/posts/#{@comment.post_id}#comment-#{@comment.id}\n\n---\n\n[i]#{CurrentUser.name} said:[/i]\n\nHey @#{@user2.name} check this out!", dmail.body)
assert_equal(<<-EOS.strip_heredoc, dmail.body)
@#{CurrentUser.name} mentioned you in a \"comment\":/posts/#{@comment.post_id}#comment-#{@comment.id} on post ##{@comment.post_id}:
[quote]
Hey @#{@user2.name} check this out!
[/quote]
EOS
end
end
end

View File

@@ -51,7 +51,13 @@ class ForumPostTest < ActiveSupport::TestCase
end
dmail = Dmail.last
assert_equal("You were mentioned in the forum topic \"#{@topic.title}\":/forum_topics/#{@topic.id}?page=1\n\n---\n\n[i]#{@user.name} said:[/i]\n\nHey @#{@user2.name} check this out!", dmail.body)
assert_equal(<<-EOS.strip_heredoc, dmail.body)
@#{CurrentUser.name} mentioned you in topic ##{@topic.id} (\"#{@topic.title}\":[/forum_topics/#{@topic.id}?page=1]):
[quote]
Hey @#{@user2.name} check this out!
[/quote]
EOS
end
end
end