diff options
author | azul <azul@riseup.net> | 2017-07-24 08:05:11 +0000 |
---|---|---|
committer | azul <azul@riseup.net> | 2017-07-24 08:05:11 +0000 |
commit | eda9a0829b670975244f39b89b23ac2695493e75 (patch) | |
tree | 6cad7ae458d6bc349a0ba925f82477feb2010fa1 /test/remote | |
parent | cfa6395c7e5728de02221b94b5f9cfe8a4debf09 (diff) | |
parent | b1738a78ccf5768f92068a27255f9f69be1c3147 (diff) |
Merge branch 'bugfix/name-resolution' into 'master'
fix: #3 handle domains without A-record
Closes #3
See merge request !15
Diffstat (limited to 'test/remote')
-rw-r--r-- | test/remote/Readme.md | 15 | ||||
-rw-r--r-- | test/remote/nicknym_source_test.rb | 15 |
2 files changed, 20 insertions, 10 deletions
diff --git a/test/remote/Readme.md b/test/remote/Readme.md index 957ea12..53f5e65 100644 --- a/test/remote/Readme.md +++ b/test/remote/Readme.md @@ -1,15 +1,14 @@ Integration tests for clients of remote services ================================================ -The tests in this directory are integration test with remote services. However -we aims at testing the client side of the equation as that is what we control -here. +The tests in this directory are integration test with remote services. +However we aims at testing the client side of the equation as that is +what we control here. -So unexpected server behavious should *crash* the test if we are not dealing -with it properly yet and have no unit test for it. +So unexpected server behavious should *crash* the test if we are not +dealing with it properly yet and have no unit test for it. -Server responses that we do not expect but handle in the code and test in unit -tests make the test *skip*. +Server responses that we do not expect but handle in the code and test +in unit tests make the test *skip*. The Behaviour we would normally expect should make the test *pass* - diff --git a/test/remote/nicknym_source_test.rb b/test/remote/nicknym_source_test.rb index 4ca3033..b97f2b2 100644 --- a/test/remote/nicknym_source_test.rb +++ b/test/remote/nicknym_source_test.rb @@ -10,13 +10,24 @@ require 'nickserver/email_address' class RemoteNicknymSourceTest < CelluloidTest include HttpAdapterHelper - def test_availablility_check + def test_available_for_mail source.available_for? 'mail.bitmask.net' - refute source.available_for? 'dl.bitmask.net' # not a provider rescue HTTP::ConnectionError => e skip e.to_s end + # not a provider + def test_not_available + refute source.available_for? 'dl.bitmask.net' + rescue HTTP::ConnectionError => e + skip e.to_s + end + + # cs.ucl.ac.uk only has an MX not an A-record + def test_not_available_without_a_record + refute source.available_for? 'cs.ucl.ac.uk' + end + def test_successful_query response = source.query(email_with_key) skip if response.status == 404 |