Test banning artist sets approver of banned_artist implication.

This commit is contained in:
evazion
2016-10-26 18:50:17 -05:00
parent 6dd8ec909d
commit 1e9bcf75de

View File

@@ -62,7 +62,8 @@ class ArtistTest < ActiveSupport::TestCase
setup do
@post = FactoryGirl.create(:post, :tag_string => "aaa")
@artist = FactoryGirl.create(:artist, :name => "aaa")
@artist.ban!
@admin = FactoryGirl.create(:admin_user)
CurrentUser.scoped(@admin) { @artist.ban! }
@post.reload
end
@@ -89,6 +90,11 @@ class ArtistTest < ActiveSupport::TestCase
assert_equal(1, TagImplication.where(:antecedent_name => "aaa", :consequent_name => "banned_artist").count)
assert_equal("aaa banned_artist", @post.tag_string)
end
should "set the approver of the banned_artist implication" do
ta = TagImplication.where(:antecedent_name => "aaa", :consequent_name => "banned_artist").first
assert_equal(@admin.id, ta.approver.id)
end
end
should "create a new wiki page to store any note information" do