summaryrefslogtreecommitdiff
path: root/test/net/hippie_test.rb
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-06-12 17:06:14 -0600
committermo khan <mo.khan@gmail.com>2020-06-12 17:08:46 -0600
commit5e327cc4abe45f53918f7afce937c37fa1736a76 (patch)
treeec54bd4c8137e05c6330ca485c2eceddc202a93b /test/net/hippie_test.rb
parent35fc5298fd9102cc99a63fa7671d09bfdc53b602 (diff)
Create default_client to simplify usage
Diffstat (limited to 'test/net/hippie_test.rb')
-rw-r--r--test/net/hippie_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/net/hippie_test.rb b/test/net/hippie_test.rb
index c5a0312..9da4abe 100644
--- a/test/net/hippie_test.rb
+++ b/test/net/hippie_test.rb
@@ -21,4 +21,17 @@ class HippieTest < Minitest::Test
Net::Hippie.verify_mode = OpenSSL::SSL::VERIFY_NONE
assert Net::Hippie.verify_mode == OpenSSL::SSL::VERIFY_NONE
end
+
+ def test_get_with_retry
+ uri = URI.parse('https://www.example.org/api/scim/v2/schemas')
+ WebMock.stub_request(:get, uri.to_s)
+ .to_timeout.then
+ .to_timeout.then
+ .to_timeout.then
+ .to_return(status: 200, body: { 'success' => 'true' }.to_json)
+ response = Net::Hippie.get(uri)
+ refute_nil response
+ assert_equal Net::HTTPOK, response.class
+ assert_equal JSON.parse(response.body)['success'], 'true'
+ end
end