summaryrefslogtreecommitdiff
path: root/test/unit/couch_db/source_unit_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/couch_db/source_unit_test.rb')
-rw-r--r--test/unit/couch_db/source_unit_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/couch_db/source_unit_test.rb b/test/unit/couch_db/source_unit_test.rb
index fd07808..e5a4f43 100644
--- a/test/unit/couch_db/source_unit_test.rb
+++ b/test/unit/couch_db/source_unit_test.rb
@@ -12,5 +12,16 @@ module Nickserver::CouchDB
Source.new(adapter).query address
adapter.verify
end
+
+ def test_401
+ address = "nick@domain.tl"
+ adapter = Minitest::Mock.new
+ adapter.expect :get, [401, nil],
+ [String, {query: { reduce: "false", key: "\"#{address}\"" }}]
+ assert_raises Error do
+ Source.new(adapter).query address
+ end
+ adapter.verify
+ end
end
end