tests: fix broken tests.

This commit is contained in:
evazion
2022-08-23 18:31:24 -05:00
parent 09dfab1f0d
commit e3af738371
16 changed files with 100 additions and 152 deletions

View File

@@ -66,6 +66,10 @@ module Source
elsif api_response[:file_url].present?
api_response[:file_url][/\.(jpg|jpeg|png|gif)\z/i, 1]
# on yande.re, the file extension doesn't matter, any random string will work. This means we can't guess the true file extension.
elsif domain == "yande.re"
"png"
# the api_response wasn't available because it's a deleted post.
elsif post_md5.present?
%w[jpg png gif].find { |ext| http_exists?("https://#{domain}/image/#{post_md5}.#{ext}") }