summaryrefslogtreecommitdiff
path: root/test/integration/dispatcher_test.rb
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2016-10-17 08:58:08 +0000
committerazul <azul@riseup.net>2016-10-17 08:58:08 +0000
commit5dae257996c480c3f7b5a220fcaf97812a560466 (patch)
tree2edc9f7b40d7b04e4cf739e6e92b200f93cd57e7 /test/integration/dispatcher_test.rb
parent6721f0732facd87404eecc288357fd1bd0de48cf (diff)
parent5967c4a568aff2c5e73e3ab933aa68d25387aeb1 (diff)
Merge branch 'feature/log-requests-and-errors' into 'master'
Log requests and errors proper logging See merge request !6
Diffstat (limited to 'test/integration/dispatcher_test.rb')
-rw-r--r--test/integration/dispatcher_test.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/integration/dispatcher_test.rb b/test/integration/dispatcher_test.rb
index 4f13e6b..b551e87 100644
--- a/test/integration/dispatcher_test.rb
+++ b/test/integration/dispatcher_test.rb
@@ -55,11 +55,11 @@ 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]
- 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