fix unit tests

This commit is contained in:
Albert Yi
2019-04-25 18:13:59 -07:00
parent 06045ac0d1
commit 6612aa1af9
7 changed files with 23 additions and 17 deletions

View File

@@ -4,10 +4,15 @@ module Downloads
class FileTest < ActiveSupport::TestCase
context "A post download" do
setup do
ENV["SKIP_CLOUDFLARE_CHECK"] = "1"
@source = "http://www.google.com/intl/en_ALL/images/logo.gif"
@download = Downloads::File.new(@source)
end
teardown do
ENV["SKIP_CLOUDFLARE_CHECK"] = nil
end
context "for a banned IP" do
setup do
Resolv.expects(:getaddress).returns("127.0.0.1").at_least_once