summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/couch_db/source_test.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/integration/couch_db/source_test.rb b/test/integration/couch_db/source_test.rb
new file mode 100644
index 0000000..9e319f4
--- /dev/null
+++ b/test/integration/couch_db/source_test.rb
@@ -0,0 +1,29 @@
+require 'test_helper'
+require 'file_content'
+require 'nickserver/couch_db/source'
+
+module Nickserver::CouchDB
+ class SourceTest < Minitest::Test
+ include FileContent
+
+ class TestAdapter
+ def initialize(status, content)
+ @status = status
+ @content = content
+ end
+
+ def get(url, opts)
+ yield @status, @content
+ end
+ end
+
+ def test_couch_query_and_response
+ adapter = TestAdapter.new 200, file_content(:blue_couchdb_result)
+ source = Source.new adapter
+ source.query 'blue@example.org' do |response|
+ assert_equal 200, response.status
+ assert_equal file_content(:blue_nickserver_result), response.content
+ end
+ end
+ end
+end