dmails: don't save copies of outgoing dmails sent by DanbooruBot.

There's not much sense in saving copies of everything DanbooruBot sends
in DanbooruBot's inbox. They probably won't be checked so it just bloats
the dmails table.
This commit is contained in:
evazion
2017-02-25 16:54:08 -06:00
parent 4d87ac028b
commit 6e3ddb6ed6
3 changed files with 26 additions and 3 deletions

View File

@@ -31,12 +31,11 @@ class UserTest < ActiveSupport::TestCase
bot = FactoryGirl.create(:user)
Danbooru.config.stubs(:system_user).returns(bot)
assert_difference("Dmail.count", 2) do
assert_difference("Dmail.count", 1) do
@user.promote_to!(User::Levels::GOLD)
end
assert(@user.dmails.exists?(from: bot, to: @user, title: "You have been promoted"))
assert(bot.dmails.exists?(from: bot, to: @user, title: "You have been promoted"))
end
end