additional fixes for deviantart artist search (#3771)

This commit is contained in:
Albert Yi
2018-07-27 12:26:39 -07:00
parent 7753461f6f
commit 135b97d511
5 changed files with 63 additions and 42 deletions

View File

@@ -228,10 +228,10 @@ class ArtistTest < ActiveSupport::TestCase
end
should "find the correct artist for page URLs" do
assert_artist_found("artgerm", "http://artgerm.deviantart.com/art/Peachy-Princess-Ver-2-457220550")
assert_artist_found("artgerm", "http://www.deviantart.com/artgerm/art/Peachy-Princess-Ver-2-457220550")
assert_artist_found("trixia", "http://trixdraws.deviantart.com/art/My-Queen-426745289")
assert_artist_found("trixia", "http://trixdraws.deviantart.com/gallery/#/d722mrt")
assert_artist_found("trixia", "http://www.deviantart.com/trixdraws/art/My-Queen-426745289")
assert_artist_found("trixia", "http://www.deviantart.com/trixdraws/gallery/#/d722mrt")
end
should "find the correct artist for image URLs" do
@@ -243,11 +243,6 @@ class ArtistTest < ActiveSupport::TestCase
assert_artist_found("trixia", "http://th01.deviantart.net/fs71/200H/i/2014/050/d/e/my_queen_by_trixdraws-d722mrt.jpg")
assert_artist_found("trixia", "http://th09.deviantart.net/fs71/PRE/i/2014/050/d/e/my_queen_by_trixdraws-d722mrt.jpg")
end
should "return nothing for unknown deviantart artists" do
assert_artist_not_found("http://guweiz.deviantart.com/art/Battleship-551905391")
assert_artist_not_found("https://orig00.deviantart.net/7585/f/2015/219/a/5/battleship__by_guweiz-d94l8xb.png")
end
end
context "when finding pixiv artists" do

View File

@@ -55,6 +55,11 @@ class ArtistUrlTest < ActiveSupport::TestCase
assert_equal("http://blog.fc2.com/monet/", url.normalized_url)
end
should "normalize deviant art artist urls" do
url = FactoryBot.create(:artist_url, :url => "https://caidychen.deviantart.com/")
assert_equal("http://www.deviantart.com/caidychen/", url.normalized_url)
end
should "normalize nico seiga artist urls" do
url = FactoryBot.create(:artist_url, :url => "http://seiga.nicovideo.jp/user/illust/1826959")
assert_equal("http://seiga.nicovideo.jp/user/illust/1826959/", url.normalized_url)

View File

@@ -57,7 +57,7 @@ module Sources
end
should "get the profile" do
assert_equal("https://noizave.deviantart.com", @site.profile_url)
assert_equal("https://www.deviantart.com/noizave", @site.profile_url)
end
should "get the artist name" do