summaryrefslogtreecommitdiff
path: root/test/support
diff options
context:
space:
mode:
Diffstat (limited to 'test/support')
-rw-r--r--test/support/http_stub_helper.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/support/http_stub_helper.rb b/test/support/http_stub_helper.rb
index b0ec069..1710b23 100644
--- a/test/support/http_stub_helper.rb
+++ b/test/support/http_stub_helper.rb
@@ -1,4 +1,5 @@
require 'nickserver/reel_server'
+require 'nickserver/email_address'
module HttpStubHelper
protected
@@ -48,6 +49,12 @@ module HttpStubHelper
stub_http_get(/#{Regexp.escape(config.couch_url)}.*#{query}/, response)
end
+ def stub_wkd_response(uid, response = {})
+ email = Nickserver::EmailAddress.new(uid)
+ url = Nickserver::Wkd::Url.new(email)
+ stub_http_get url, response, Hash
+ end
+
def stub_http_get(url, response, options = nil)
response = { status: 200, body: '' }.merge(response || {})
adapter.expect :get, [response[:status], response[:body]],