nijie: support preview urls (#3919).

This commit is contained in:
evazion
2018-09-24 17:08:37 -05:00
parent 99babe19f3
commit d9063a9f2a
3 changed files with 66 additions and 10 deletions

View File

@@ -19,7 +19,22 @@ module DownloadTestHelper
assert_rewritten(source, source, referer)
end
def assert_http_exists(url, headers: {})
res = HTTParty.head(url, Danbooru.config.httparty_options.deep_merge(headers: headers))
assert_equal(true, res.success?)
end
def assert_http_status(code, url, headers: {})
res = HTTParty.head(url, Danbooru.config.httparty_options.deep_merge(headers: headers))
assert_equal(code, res.code)
end
def assert_http_size(size, url, headers: {})
res = HTTParty.head(url, Danbooru.config.httparty_options.deep_merge(headers: headers))
assert_equal(size, res.content_length)
end
def check_ffmpeg
File.which("ffmpeg") && File.which("mkvmerge")
end
end
end