fix tests for new code

This commit is contained in:
Kyle Drake 2016-10-23 13:05:10 -05:00
parent 80b3f6b0be
commit d5493d4d23
3 changed files with 5 additions and 29 deletions

View file

@ -53,7 +53,7 @@ GEM
rack (>= 1.1.0)
uuidtools (~> 2.1.1)
docile (1.1.5)
domain_name (0.5.20160310)
domain_name (0.5.20160826)
unf (>= 0.0.5, < 1.0.0)
drydock (0.6.9)
erubis (2.7.0)
@ -77,12 +77,12 @@ GEM
hoe (3.14.2)
rake (>= 0.8, < 11.0)
htmlentities (4.3.4)
http (2.0.1)
http (2.0.3)
addressable (~> 2.3)
http-cookie (~> 1.0)
http-form_data (~> 1.0.1)
http_parser.rb (~> 0.6.0)
http-cookie (1.0.2)
http-cookie (1.0.3)
domain_name (~> 0.5)
http-form_data (1.0.1)
http_parser.rb (0.6.0)
@ -231,7 +231,7 @@ GEM
unf_ext
unf_ext (0.0.7.2)
uuidtools (2.1.5)
webmock (1.24.2)
webmock (2.1.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
@ -321,4 +321,4 @@ DEPENDENCIES
zipruby
BUNDLED WITH
1.12.1
1.12.5

View file

@ -5,18 +5,6 @@ describe DeleteCacheWorker do
@test_ip = '10.0.0.1'
end
it 'throws exception without 200 or 404 http status' do
stub_request(:get, "http://#{@test_ip}/:cache/purge/test.jpg").
with(headers: {'Host' => 'kyledrake.neocities.org'})
.to_return(status: 503)
worker = DeleteCacheWorker.new
proc {
worker.perform @test_ip, 'kyledrake', '/test.jpg'
}.must_raise RestClient::ServiceUnavailable
end
it 'handles 404 without exception' do
stub_request(:get, "http://#{@test_ip}/:cache/purge/test.jpg").
with(headers: {'Host' => 'kyledrake.neocities.org'})

View file

@ -5,18 +5,6 @@ describe PurgeCacheWorker do
@test_ip = '10.0.0.1'
end
it 'throws exception without 200 or 404 http status' do
stub_request(:head, "http://#{@test_ip}/test.jpg").
with(headers: {'Host' => 'kyledrake.neocities.org', 'Cache-Purge' => '1'})
.to_return(status: 503)
worker = PurgeCacheWorker.new
proc {
worker.perform @test_ip, 'kyledrake', '/test.jpg'
}.must_raise RestClient::ServiceUnavailable
end
it 'handles 404 without exception' do
stub_request(:head, "http://#{@test_ip}/test.jpg").
with(headers: {'Host' => 'kyledrake.neocities.org', 'Cache-Purge' => '1'})