summaryrefslogtreecommitdiff
path: root/test/remote
diff options
context:
space:
mode:
Diffstat (limited to 'test/remote')
-rw-r--r--test/remote/Readme.md15
-rw-r--r--test/remote/nicknym_source_test.rb15
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