From d5493d4d231fa92ea74a3a77737c9f088fac3531 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sun, 23 Oct 2016 13:05:10 -0500 Subject: [PATCH] fix tests for new code --- Gemfile.lock | 10 +++++----- tests/workers/delete_cache_worker_tests.rb | 12 ------------ tests/workers/purge_cache_worker_tests.rb | 12 ------------ 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b858543b..94996c99 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 diff --git a/tests/workers/delete_cache_worker_tests.rb b/tests/workers/delete_cache_worker_tests.rb index 70f6f690..b5ca1752 100644 --- a/tests/workers/delete_cache_worker_tests.rb +++ b/tests/workers/delete_cache_worker_tests.rb @@ -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'}) diff --git a/tests/workers/purge_cache_worker_tests.rb b/tests/workers/purge_cache_worker_tests.rb index b07bc3c7..a627cd35 100644 --- a/tests/workers/purge_cache_worker_tests.rb +++ b/tests/workers/purge_cache_worker_tests.rb @@ -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'})