blob: b04e68586b55e15cbad87174cd178110b4107327 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
require 'test_helper'
class Net::Hippie::ClientTest < Minitest::Test
attr_reader :subject
def initialize(*args)
super
@subject = Net::Hippie::Client.new(headers: {
'Accept' => 'application/vnd.haveibeenpwned.v2+json'
})
end
def test_get
VCR.use_cassette("get_breaches") do
uri = URI.parse('https://haveibeenpwned.com/api/breaches')
response = subject.get(uri)
refute_nil response
assert_equal(283, JSON.parse(response.body).count)
end
end
end
|