From 91dd5a8b3c6d7bc6b06852c1659564c5559d743d Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 25 Apr 2016 22:24:05 -0300 Subject: [tests] better error message when identity test cannot contact api. closes #8046 --- tests/helpers/bonafide_helper.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/helpers') 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) -- cgit v1.2.3