From c32bce3399eb1bca8987a49ecc89700458803250 Mon Sep 17 00:00:00 2001 From: Azul Date: Sat, 24 Sep 2016 11:56:59 +0200 Subject: test: rename so no name is duplicated --- test/integration/dispatcher_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/integration') diff --git a/test/integration/dispatcher_test.rb b/test/integration/dispatcher_test.rb index 4f13e6b..4757e83 100644 --- a/test/integration/dispatcher_test.rb +++ b/test/integration/dispatcher_test.rb @@ -55,7 +55,7 @@ class Nickserver::DispatcherTest < Minitest::Test assert_response success end - def test_email_via_hkp_nicknym_unreachable + def test_email_not_found_hkp_nicknym_unreachable handle address: ['valid@email.tld'], headers: { "Host" => "http://nickserver.me" } stub_nicknym_raises hkp_source.expect :query, nil, [Nickserver::EmailAddress] -- cgit v1.2.3 From 4cd842927a60e4e81915da22983f216ccd54d6a3 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 29 Sep 2016 12:56:14 +0200 Subject: skip tests with ConnectionErrors We handle these errors nicely in the dispatcher and have tests for that. Tests should fail or err out when running into exceptions we are not handling yet. But for these it's better to just skip. --- test/integration/dispatcher_test.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/integration') diff --git a/test/integration/dispatcher_test.rb b/test/integration/dispatcher_test.rb index 4757e83..b551e87 100644 --- a/test/integration/dispatcher_test.rb +++ b/test/integration/dispatcher_test.rb @@ -59,7 +59,7 @@ class Nickserver::DispatcherTest < Minitest::Test handle address: ['valid@email.tld'], headers: { "Host" => "http://nickserver.me" } stub_nicknym_raises hkp_source.expect :query, nil, [Nickserver::EmailAddress] - assert_response response(status: 502, content: "HTTP::ConnectionError") + assert_response http_connection_error end def test_email_via_nicknym @@ -126,6 +126,11 @@ class Nickserver::DispatcherTest < Minitest::Test response status: 500, content: "500 #{msg}\n" end + def http_connection_error + response status: 502, + content: JSON.dump(error: "HTTP::ConnectionError") + end + def response(options) Nickserver::Response.new(options[:status], options[:content]) end -- cgit v1.2.3 From 5967c4a568aff2c5e73e3ab933aa68d25387aeb1 Mon Sep 17 00:00:00 2001 From: Azul Date: Sun, 2 Oct 2016 15:05:02 +0200 Subject: silence Celluloid.logger in tests Introduced CelluloidTest as a test class for all tests that depend on Celluloid being up and running. --- test/integration/hkp_test.rb | 11 ----------- test/integration/nicknym_test.rb | 11 ----------- test/integration/nickserver_test.rb | 16 ++++------------ 3 files changed, 4 insertions(+), 34 deletions(-) delete mode 100644 test/integration/nicknym_test.rb (limited to 'test/integration') diff --git a/test/integration/hkp_test.rb b/test/integration/hkp_test.rb index 7d4bb6b..da128c2 100644 --- a/test/integration/hkp_test.rb +++ b/test/integration/hkp_test.rb @@ -5,17 +5,6 @@ require 'nickserver/hkp/source' class HkpTest < Minitest::Test include HttpStubHelper - def setup - super - Celluloid.boot - end - - def teardown - Celluloid.shutdown - super - end - - def test_key_info_expired fetch_key_info(:hkp_vindex_result, 'lemur@leap.se') do |keys| assert_equal 1, keys.length, 'should find a single key' diff --git a/test/integration/nicknym_test.rb b/test/integration/nicknym_test.rb deleted file mode 100644 index bfcd7e1..0000000 --- a/test/integration/nicknym_test.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'test_helper' -require 'support/client_integration_test' -require 'nickserver/nicknym/source' - -class NicknymClientTest < ClientIntegrationTest - - def test_truth - assert true - end - -end diff --git a/test/integration/nickserver_test.rb b/test/integration/nickserver_test.rb index 06d6e29..5dffcd2 100644 --- a/test/integration/nickserver_test.rb +++ b/test/integration/nickserver_test.rb @@ -1,4 +1,5 @@ require 'test_helper' +require 'support/celluloid_test' require 'support/http_stub_helper' require 'nickserver/server' require 'json' @@ -15,24 +16,15 @@ require 'json' # # (1) We mock the http adapter. So no network is required. # -# (2) We actually start the nickserver on 127.0.0.1 and talk to it via http. +# (2) We actually start the Reelserver on 127.0.0.1 and talk to it via http. +# In order to run the Reelserver properly this is a celluloid test. # # (3) the "Host" header for requests to nickserver must be set (or Config.domain set) # -class NickserverTest < Minitest::Test +class NickserverTest < CelluloidTest include HttpStubHelper - def setup - super - Celluloid.boot - end - - def teardown - Celluloid.shutdown - super - end - def test_GET_key_by_email_address_served_via_SKS uid = 'cloudadmin@leap.se' key_id = 'E818C478D3141282F7590D29D041EB11B1647490' -- cgit v1.2.3