Normalize pixiv artist urls to pixiv member page (fix #3048).

This commit is contained in:
evazion
2017-05-15 12:11:26 -05:00
parent 78b08d8394
commit eac827973b
4 changed files with 10 additions and 15 deletions

View File

@@ -204,8 +204,8 @@ class ArtistTest < ActiveSupport::TestCase
context "when finding pixiv artists" do
setup do
FactoryGirl.create(:artist, :name => "masao",:url_string => "http://i2.pixiv.net/img04/img/syounen_no_uta/")
FactoryGirl.create(:artist, :name => "bkub", :url_string => "http://i1.pixiv.net/img01/img/bkubb/")
FactoryGirl.create(:artist, :name => "masao",:url_string => "http://www.pixiv.net/member.php?id=32777")
FactoryGirl.create(:artist, :name => "bkub", :url_string => "http://www.pixiv.net/member.php?id=9948")
FactoryGirl.create(:artist, :name => "ryuura", :url_string => "http://www.pixiv.net/member.php?id=8678371")
end

View File

@@ -52,9 +52,9 @@ class ArtistUrlTest < ActiveSupport::TestCase
end
should "normalize pixiv urls" do
url = FactoryGirl.create(:artist_url, :url => "http://img55.pixiv.net/img/monet")
assert_equal("http://img55.pixiv.net/img/monet", url.url)
assert_equal("http://img.pixiv.net/img/monet/", url.normalized_url)
url = FactoryGirl.create(:artist_url, :url => "https://i.pximg.net/img-original/img/2010/11/30/08/39/58/14901720_p0.png")
assert_equal("https://i.pximg.net/img-original/img/2010/11/30/08/39/58/14901720_p0.png", url.url)
assert_equal("http://www.pixiv.net/member.php?id=339253/", url.normalized_url)
end
should "normalize twitter urls" do