nicoseiga: fix canonical_url to use the image url.

This commit is contained in:
evazion
2018-09-22 11:07:18 -05:00
parent 09a8198979
commit 39f9e01b13
2 changed files with 10 additions and 0 deletions

View File

@@ -70,6 +70,10 @@ module Sources
return super
end
def canonical_url
image_url
end
def profile_url
if url =~ PROFILE
return url

View File

@@ -28,6 +28,11 @@ module Sources
assert_match(/^http:\/\/lohas\.nicoseiga\.jp\/priv\//, @site_2.image_url)
end
should "get the canonical url" do
assert_match(%r!\Ahttps?://lohas\.nicoseiga\.jp/priv/\h{40}/\d+/4937663!, @site_1.canonical_url)
assert_match(%r!\Ahttps?://lohas\.nicoseiga\.jp/priv/\h{40}/\d+/4937663!, @site_2.canonical_url)
end
should "get the tags" do
assert(@site_1.tags.size > 0)
first_tag = @site_1.tags.first
@@ -52,6 +57,7 @@ module Sources
full_image_url = %r!https?://lohas.nicoseiga.jp/priv/[a-f0-9]{40}/[0-9]+/6844226!
assert_match(full_image_url, site.image_url)
assert_match(full_image_url, site.canonical_url)
end
end
end