artists: reduce queries in artist summaries.

Avoid a few queries when searching for single artist tags.
This commit is contained in:
evazion
2019-09-05 00:00:15 -05:00
parent 416f817f6d
commit fc3b822bdf
3 changed files with 2 additions and 28 deletions

View File

@@ -64,21 +64,6 @@ class ArtistTest < ActiveSupport::TestCase
should_not allow_value("").for(:name)
end
context "with a matching tag alias" do
setup do
@tag_alias = FactoryBot.create(:tag_alias, :antecedent_name => "aaa", :consequent_name => "bbb")
@artist = FactoryBot.create(:artist, :name => "aaa")
end
should "know it has an alias" do
assert_equal(true, @artist.has_tag_alias?)
end
should "know its alias" do
assert_equal("bbb", @artist.tag_alias_name)
end
end
context "that has been banned" do
setup do
@post = FactoryBot.create(:post, :tag_string => "aaa")