Don't email about posts if the user deleted it.

This commit is contained in:
Robin Ward
2013-03-25 13:40:48 -04:00
parent ba315c6610
commit 90443dac30
2 changed files with 9 additions and 0 deletions
+6
View File
@@ -70,6 +70,12 @@ describe Jobs::UserEmail do
Jobs::UserEmail.new.execute(type: :private_message, user_id: user.id, post_id: post.id)
end
it "doesn't send the email if the user deleted the post" do
EmailSender.any_instance.expects(:send).never
post.update_column(:user_deleted, true)
Jobs::UserEmail.new.execute(type: :private_message, user_id: user.id, post_id: post.id)
end
end