tests: fix broken tests.

This commit is contained in:
evazion
2022-08-24 02:03:37 -05:00
parent 09dfab1f0d
commit e3af738371
16 changed files with 100 additions and 152 deletions
+4
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}") }