diff options
author | elijah <elijah@riseup.net> | 2016-04-25 22:24:05 -0300 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2016-04-25 22:24:47 -0300 |
commit | 91dd5a8b3c6d7bc6b06852c1659564c5559d743d (patch) | |
tree | f599828748f1ff78c8ce83d78629375b8683ff7f /tests | |
parent | 07f8cf9c307471128eef1ded3a77633869c89bcd (diff) |
[tests] better error message when identity test cannot contact api. closes #8046
Diffstat (limited to 'tests')
-rw-r--r-- | tests/helpers/bonafide_helper.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/helpers/bonafide_helper.rb b/tests/helpers/bonafide_helper.rb index 95e3e3b7..5b886228 100644 --- a/tests/helpers/bonafide_helper.rb +++ b/tests/helpers/bonafide_helper.rb @@ -90,7 +90,10 @@ class LeapTest # def identity_exists?(address) url = api_url("/identities/#{URI.encode(address)}.json") - get(url, nil, api_options(:auth => :monitor)) do |body, response| + options = {:ok_codes => [200, 404]}.merge( + api_options(:auth => :monitor) + ) + assert_get(url, nil, options) do |body, response| return response.code == "200" end end @@ -118,7 +121,9 @@ class LeapTest # def find_user_by_login(login) url = api_url("/users/0.json?login=#{login}") - options = {:ok_codes => [200, 404]}.merge(api_options(:auth => :monitor)) + options = {:ok_codes => [200, 404]}.merge( + api_options(:auth => :monitor) + ) assert_get(url, nil, options) do |body, response| if response.code == "200" return JSON.parse(body) |