Fix #4940: DanbooruBot retiring banned_artist implications.

This commit is contained in:
evazion
2022-01-11 10:28:33 -06:00
parent 422dbbc72e
commit 40d6351249
3 changed files with 28 additions and 2 deletions

View File

@@ -101,5 +101,16 @@ class RetireTagRelationshipsJobTest < ActiveJob::TestCase
assert_equal(true, ta3.reload.is_retired?)
assert_equal(true, ta4.reload.is_retired?)
end
should "not retire empty banned_artist implications" do
bkub = create(:tag, name: "bkub", post_count: 0, category: Tag.categories.artist)
banned_artist = create(:tag, name: "banned_artist", post_count: 0, category: Tag.categories.artist)
ti = create(:tag_implication, antecedent_name: "bkub", consequent_name: "banned_artist")
RetireTagRelationshipsJob.perform_now
assert_equal(false, ti.reload.is_retired?)
assert_equal(true, bkub.implies?("banned_artist"))
end
end
end