This commit is contained in:
r888888888
2013-04-16 22:24:36 -07:00
parent e4895ffab1
commit 0754206031
2 changed files with 10 additions and 1 deletions

View File

@@ -817,7 +817,7 @@ class Post < ActiveRecord::Base
update_column(:is_deleted, true)
update_column(:is_pending, false)
update_column(:is_flagged, false)
update_column(:is_banned, true) if options[:ban]
update_column(:is_banned, true) if options[:ban] || has_tag?("banned_artist")
unless options[:without_mod_action]
ModAction.create(:description => "deleted post ##{id}")

View File

@@ -56,6 +56,15 @@ class PostTest < ActiveSupport::TestCase
end
end
context "with the banned_artist tag" do
should "also ban the post" do
post = FactoryGirl.create(:post, :tag_string => "banned_artist")
post.delete!
post.reload
assert(post.is_banned?)
end
end
should "update the fast count" do
post = FactoryGirl.create(:post, :tag_string => "aaa")
assert_equal(1, Post.fast_count)