Refactor sources
This commit is contained in:
@@ -8,17 +8,19 @@ module Downloads
|
||||
@source = "https://twitter.com/CincinnatiZoo/status/859073537713328129"
|
||||
@rewrite = "https://video.twimg.com/ext_tw_video/859073467769126913/pu/vid/1280x720/cPGgVROXHy3yrK6u.mp4"
|
||||
assert_rewritten(@rewrite, @source)
|
||||
assert_downloaded(8_602_983, @source)
|
||||
|
||||
# this takes awhile so just skip it unless we really want to test it
|
||||
# assert_downloaded(8_602_983, @source)
|
||||
end
|
||||
end
|
||||
|
||||
context "downloading a 'https://twitter.com/:user/status/:id/photo/:n' card url" do
|
||||
should "download the orig file" do
|
||||
skip "Twitter key is not set" unless Danbooru.config.twitter_api_key
|
||||
@source = "https://twitter.com/masayasuf/status/870734961778630656/photo/1"
|
||||
@rewrite = "https://pbs.twimg.com/media/DBV40M2UIAAHYlt.jpg:orig"
|
||||
@source = "https://twitter.com/ry_o_ta_/status/1024316791688843269/photo/1"
|
||||
@rewrite = "https://pbs.twimg.com/media/Djcar72VsAAZsGa.jpg:orig"
|
||||
assert_rewritten(@rewrite, @source)
|
||||
assert_downloaded(788_206, @source)
|
||||
assert_downloaded(103812, @source)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -37,8 +39,9 @@ module Downloads
|
||||
skip "Twitter key is not set" unless Danbooru.config.twitter_api_key
|
||||
@source = "https://pbs.twimg.com/media/B4HSEP5CUAA4xyu.png:large"
|
||||
@rewrite = "https://pbs.twimg.com/media/B4HSEP5CUAA4xyu.png:orig"
|
||||
assert_rewritten(@rewrite, @source)
|
||||
assert_downloaded(9800, @source)
|
||||
@ref = "https://twitter.com/nounproject/status/540944400767922176"
|
||||
assert_rewritten(@rewrite, @source, @ref)
|
||||
assert_downloaded(9800, @source, @ref)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user