Auto-promote DanbooruBot to Mod. Auto-create DanbooruBot if it doesn't exist.
This commit is contained in:
@@ -177,7 +177,7 @@ class DmailTest < ActiveSupport::TestCase
|
||||
context "that is automated" do
|
||||
setup do
|
||||
@bot = FactoryGirl.create(:user)
|
||||
Danbooru.config.stubs(:system_user).returns(@bot)
|
||||
User.stubs(:system).returns(@bot)
|
||||
end
|
||||
|
||||
should "only create a copy for the recipient" do
|
||||
|
||||
@@ -85,7 +85,7 @@ class PostDisapprovalTest < ActiveSupport::TestCase
|
||||
|
||||
should "dmail the uploaders" do
|
||||
bot = FactoryGirl.create(:user)
|
||||
Danbooru.config.stubs(:system_user).returns(bot)
|
||||
User.stubs(:system).returns(bot)
|
||||
|
||||
assert_difference(["@uploaders[0].dmails.count", "@uploaders[1].dmails.count"], 1) do
|
||||
PostDisapproval.dmail_messages!
|
||||
|
||||
@@ -20,7 +20,7 @@ class PostReplacementTest < ActiveSupport::TestCase
|
||||
Delayed::Worker.delay_jobs = true # don't delete the old images right away
|
||||
|
||||
@system = FactoryGirl.create(:user, created_at: 2.weeks.ago)
|
||||
Danbooru.config.stubs(:system_user).returns(@system)
|
||||
User.stubs(:system).returns(@system)
|
||||
|
||||
@uploader = FactoryGirl.create(:user, created_at: 2.weeks.ago, can_upload_free: true)
|
||||
@replacer = FactoryGirl.create(:user, created_at: 2.weeks.ago, can_approve_posts: true)
|
||||
|
||||
@@ -28,7 +28,7 @@ class UserTest < ActiveSupport::TestCase
|
||||
|
||||
should "send an automated dmail to the user" do
|
||||
bot = FactoryGirl.create(:user)
|
||||
Danbooru.config.stubs(:system_user).returns(bot)
|
||||
User.stubs(:system).returns(bot)
|
||||
|
||||
assert_difference("Dmail.count", 1) do
|
||||
@user.promote_to!(User::Levels::GOLD)
|
||||
|
||||
Reference in New Issue
Block a user