normalize nijie popup urls (fixes #3153)

This commit is contained in:
r888888888
2017-06-14 12:14:55 -07:00
parent cdef9fda7d
commit 6174d0eef2
2 changed files with 33 additions and 6 deletions

View File

@@ -25,6 +25,25 @@ module Sources
end
end
context "The source site for a nijie referer url" do
setup do
@site = Sources::Site.new("http://pic03.nijie.info/nijie_picture/728995_20170505014820_0.jpg", referer_url: "https://nijie.info/view_popup.php?id=213043")
@site.get
end
should "get the image url" do
assert_equal("http://pic03.nijie.info/nijie_picture/728995_20170505014820_0.jpg", @site.image_url)
end
should "get the profile" do
assert_equal("http://nijie.info/members.php?id=728995", @site.profile_url)
end
should "get the artist name" do
assert_equal("", @site.artist_name)
end
end
context "The source site for a nijie popup" do
setup do
@site = Sources::Site.new("https://nijie.info/view_popup.php?id=213043")
@@ -42,10 +61,6 @@ module Sources
should "get the artist name" do
assert_equal("", @site.artist_name)
end
should "get the tags" do
assert_equal([["眼鏡", "http://nijie.info/search.php?word=%E7%9C%BC%E9%8F%A1"], ["リトルウィッチアカデミア", "http://nijie.info/search.php?word=%E3%83%AA%E3%83%88%E3%83%AB%E3%82%A6%E3%82%A3%E3%83%83%E3%83%81%E3%82%A2%E3%82%AB%E3%83%87%E3%83%9F%E3%82%A2"], ["アーシュラ先生", "http://nijie.info/search.php?word=%E3%82%A2%E3%83%BC%E3%82%B7%E3%83%A5%E3%83%A9%E5%85%88%E7%94%9F"]], @site.tags)
end
end
end
end