summaryrefslogtreecommitdiff
path: root/test/support/http_stub_helper.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-09-21 12:48:11 +0200
committerAzul <azul@riseup.net>2016-09-21 12:48:11 +0200
commit6f507ed7b4f53054313173ce795ffd2cbcecd0b7 (patch)
treeb40778b15d9ea82012d7e8330ac8dbf262f58ca2 /test/support/http_stub_helper.rb
parentdd71240fe4f4f968b9b687917cb6d7ad5812ba48 (diff)
feature: activate nicknym lookup
Diffstat (limited to 'test/support/http_stub_helper.rb')
-rw-r--r--test/support/http_stub_helper.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/support/http_stub_helper.rb b/test/support/http_stub_helper.rb
index 6b05f98..cb9b578 100644
--- a/test/support/http_stub_helper.rb
+++ b/test/support/http_stub_helper.rb
@@ -7,6 +7,11 @@ module HttpStubHelper
adapter.verify
end
+ def stub_nicknym_available_response(domain, response = {})
+ stub_http_request :get, "https://#{domain}/provider.json",
+ response: response
+ end
+
def stub_sks_vindex_reponse(uid, response = {})
stub_http_request :get, config.hkp_url,
query: {op: 'vindex', search: uid, exact: 'on', options: 'mr', fingerprint: 'on'},
@@ -28,8 +33,9 @@ module HttpStubHelper
def stub_http_request(verb, url, options = {})
response = {status: 200, body: ""}.merge(options.delete(:response) || {})
+ options = nil if options == {}
adapter.expect :get, [response[:status], response[:body]],
- [url, options]
+ [url, options].compact
end
def adapter