twitter: add tests for uploading profile banners (#4520).

This commit is contained in:
evazion
2020-06-23 02:37:21 -05:00
parent f2ae9eeae0
commit 73506bac33
2 changed files with 9 additions and 0 deletions

View File

@@ -339,6 +339,7 @@ class UploadsControllerTest < ActionDispatch::IntegrationTest
should_upload_successfully("https://twitter.com/noizave/status/875768175136317440")
should_upload_successfully("https://pbs.twimg.com/media/DCdZ_FhUIAAYKFN?format=jpg&name=medium")
should_upload_successfully("https://pbs.twimg.com/profile_banners/1225702850002468864/1588597370/1500x500")
# XXX should_upload_successfully("https://video.twimg.com/tweet_video/EWHWVrmVcAAp4Vw.mp4")
should_upload_successfully("https://www.weibo.com/5501756072/J2UNKfbqV")

View File

@@ -244,6 +244,14 @@ module Sources
end
end
context "A profile banner image" do
should "work" do
@site = Sources::Strategies.find("https://pbs.twimg.com/profile_banners/1225702850002468864/1588597370/1500x500")
assert_equal(@site.image_url, @site.url)
assert_nothing_raised { @site.to_h }
end
end
context "A tweet containing non-normalized Unicode text" do
should "be normalized to nfkc" do
site = Sources::Strategies.find("https://twitter.com/aprilarcus/status/367557195186970624")