From 402caf6168ee955103726a4e4476d69921c60859 Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 16 May 2017 22:49:09 -0500 Subject: [PATCH] post replacement: don't send @mention dmails to replacer. --- app/models/post_replacement.rb | 2 +- test/unit/post_replacement_test.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/post_replacement.rb b/app/models/post_replacement.rb index 7caa200b8..5ff7f9183 100644 --- a/app/models/post_replacement.rb +++ b/app/models/post_replacement.rb @@ -90,7 +90,7 @@ class PostReplacement < ActiveRecord::Base module PresenterMethods def comment_replacement_message - "@#{creator.name} replaced this post with a new image:\n\n#{replacement_message}" + %("#{creator.name}":[/users/#{creator.id}] replaced this post with a new image:\n\n#{replacement_message}) end def modaction_replacement_message diff --git a/test/unit/post_replacement_test.rb b/test/unit/post_replacement_test.rb index 83f3aa66e..8b827b133 100644 --- a/test/unit/post_replacement_test.rb +++ b/test/unit/post_replacement_test.rb @@ -94,7 +94,11 @@ class PostReplacementTest < ActiveSupport::TestCase assert_not_nil(comment) assert_equal(User.system.id, comment.creator_id) - assert_match(/@#{@replacer.name} replaced this post/, comment.body) + assert_match(/replaced this post/, comment.body) + end + + should "not send an @mention to the replacer" do + assert_equal(0, @replacer.dmails.size) end end