dmails: only spam check recipient's copy of the dmail.

Each dmail creates two copies, one for the sender and one for the
receiver. Only spam check the receiver's copy.

Prevents senders from being able to tell when their messages are being
spam filtered.
This commit is contained in:
evazion
2017-12-15 12:38:17 -06:00
parent eab63daa29
commit b48211cd4a
2 changed files with 5 additions and 5 deletions

View File

@@ -23,8 +23,8 @@ class DmailTest < ActiveSupport::TestCase
should "not validate" do
assert_difference("Dmail.count", 2)do
dmail = Dmail.create_split(:to_id => @recipient.id, :title => "My video", :body => "hey Noneeditsonlyme. My webcam see here http://bit.ly/2vTv9Ki")
assert(dmail.is_spam?)
Dmail.create_split(:to_id => @recipient.id, :title => "My video", :body => "hey Noneeditsonlyme. My webcam see here http://bit.ly/2vTv9Ki")
assert(@recipient.dmails.last.is_spam?)
end
end
end