pixiv: fix regression with new user profile urls.

* Update tests to use new Pixiv profile urls.
* Fix issue with artist finder not working when given direct image or
  html page urls.
This commit is contained in:
evazion
2020-06-24 02:32:07 -05:00
parent 1d369f4574
commit 8eac82a971
3 changed files with 7 additions and 6 deletions

View File

@@ -529,7 +529,7 @@ class ArtistTest < ActiveSupport::TestCase
assert_equal("niceandcool", artist.name)
assert_equal("nice_and_cool", artist.other_names_string)
assert_includes(artist.urls.map(&:url), "https://www.pixiv.net/member.php?id=906442")
assert_includes(artist.urls.map(&:url), "https://www.pixiv.net/users/906442")
assert_includes(artist.urls.map(&:url), "https://www.pixiv.net/stacc/niceandcool")
end
@@ -540,7 +540,7 @@ class ArtistTest < ActiveSupport::TestCase
assert_equal("test_artist", artist.name)
assert_equal("nice_and_cool niceandcool", artist.other_names_string)
assert_includes(artist.urls.map(&:url), "https://www.pixiv.net/member.php?id=906442")
assert_includes(artist.urls.map(&:url), "https://www.pixiv.net/users/906442")
assert_includes(artist.urls.map(&:url), "https://www.pixiv.net/stacc/niceandcool")
end
end

View File

@@ -103,7 +103,7 @@ module Sources
girls_frontline hara_shoutarou hoodie long_hair pantyhose scar skirt
twintails ump-45_(girls_frontline) ump-9_(girls_frontline)
]
@profile_url = "https://www.pixiv.net/member.php?id=22528152"
@profile_url = "https://www.pixiv.net/users/22528152"
@data = { site_name: "konachan.com", preview_url: @prev, image_url: @full, page_url: @page, size: @size, tags: @tags, profile_url: @profile_url }
assert_source_data_equals(@samp, **@data)