From 8bba1b0a5421bcc3288e7c418cfc983d7691e9c8 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 10 Mar 2022 15:04:02 -0600 Subject: [PATCH] weibo: add test for m.weibo.cn/detail urls. --- test/unit/sources/weibo_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/unit/sources/weibo_test.rb b/test/unit/sources/weibo_test.rb index 43a385a38..bf759f1bb 100644 --- a/test/unit/sources/weibo_test.rb +++ b/test/unit/sources/weibo_test.rb @@ -93,6 +93,23 @@ module Sources end end + context "A m.weibo.cn/detail url" do + should "work" do + @site = Sources::Strategies.find("https://m.weibo.cn/detail/4506950043618873") + + assert_equal(%w[ + https://wx1.sinaimg.cn/large/0060kO5aly1gezsyt5xvhj30ok0sgtc9.jpg + https://wx3.sinaimg.cn/large/0060kO5aly1gezsyuaas1j30go0sgjtj.jpg + https://wx3.sinaimg.cn/large/0060kO5aly1gezsys1ai9j30gi0sg0v9.jpg + ], @site.image_urls) + + assert_equal("https://www.weibo.com/5501756072/J2UNKfbqV", @site.page_url) + assert_equal("https://www.weibo.com/5501756072/J2UNKfbqV", @site.canonical_url) + assert_equal(%w[fgo Alter组], @site.tags.map(&:first)) + assert_equal("阿尔托莉雅厨", @site.artist_name) + end + end + context "normalizing for source" do should "normalize correctly" do source1 = "https://www.weibo.com/3150932560/H4cFbeKKA?from=page_1005053150932560_profile&wvr=6&mod=weibotime"