Fix broken test artist controller tests, tag alias test.
This commit is contained in:
@@ -203,12 +203,9 @@ class TagAlias < TagRelationship
|
|||||||
end
|
end
|
||||||
|
|
||||||
if antecedent_tag.category == Tag.categories.artist
|
if antecedent_tag.category == Tag.categories.artist
|
||||||
antecedent_artist = Artist.name_matches(antecedent_name).first
|
if antecedent_tag.artist.present? && consequent_tag.artist.blank?
|
||||||
if antecedent_artist.present? && Artist.name_matches(consequent_name).blank?
|
|
||||||
CurrentUser.scoped(creator, creator_ip_addr) do
|
CurrentUser.scoped(creator, creator_ip_addr) do
|
||||||
antecedent_artist.update_attributes(
|
antecedent_tag.artist.update!(name: consequent_name)
|
||||||
:name => consequent_name
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -106,13 +106,13 @@ class ArtistsControllerTest < ActionDispatch::IntegrationTest
|
|||||||
end
|
end
|
||||||
|
|
||||||
should "find artists by image URL" do
|
should "find artists by image URL" do
|
||||||
get artists_path(name: "http://i2.pixiv.net/img04/img/syounen_no_uta/46170939_m.jpg", format: "json")
|
get artists_path(search: { url_matches: "http://i2.pixiv.net/img04/img/syounen_no_uta/46170939_m.jpg" }, format: "json")
|
||||||
assert_artist_found("masao")
|
assert_artist_found("masao")
|
||||||
end
|
end
|
||||||
|
|
||||||
should "find artists by page URL" do
|
should "find artists by page URL" do
|
||||||
url = "http://www.pixiv.net/member_illust.php?mode=medium&illust_id=46170939"
|
url = "http://www.pixiv.net/member_illust.php?mode=medium&illust_id=46170939"
|
||||||
get artists_path(name: url, format: "json")
|
get artists_path(search: { url_matches: url }, format: "json")
|
||||||
assert_artist_found("masao")
|
assert_artist_found("masao")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user