Class: TestNaiveHttpClient

Inherits:
Minitest::Test
  • Object
show all
Defined in:
lib/authing_ruby/test/mini_test/TestNaiveHttpClient.rb

Instance Method Summary collapse

Instance Method Details

#test_getObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/authing_ruby/test/mini_test/TestNaiveHttpClient.rb', line 15

def test_get
   http = AuthingRuby::Common::NaiveHttpClient.new()
   url = "https://postman-echo.com/get"
   params = {
     "a": 3
   }
   resp = http.request({
     method: 'GET',
     url: url,
     params: params,
		headers: { b: "100" },
   })
   json = JSON.parse(resp.body)
   # puts JSON.pretty_generate(json)
   assert(json.dig('args', "a") == "3")
   assert(json.dig('headers', "b") == "100")
end

#test_initObject



11
12
13
# File 'lib/authing_ruby/test/mini_test/TestNaiveHttpClient.rb', line 11

def test_init
   naiveHttpClient = AuthingRuby::Common::NaiveHttpClient.new
end