From d86db217055ecf64787412516ae0214fe1d8c31a Mon Sep 17 00:00:00 2001 From: Geno Date: Fri, 10 Sep 2021 23:52:30 +0200 Subject: [PATCH] fix(web): test for json request --- web/request_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/request_test.go b/web/request_test.go index 733f00b..dc39242 100644 --- a/web/request_test.go +++ b/web/request_test.go @@ -10,14 +10,14 @@ func TestJSONRequest(t *testing.T) { assert := assert.New(t) data := struct { - IP string `json:"ip"` + IP string `json:"query"` }{} - err := JSONRequest("http://ip.jsontest.com/", &data) + err := JSONRequest("http://ip-api.com/json/?fields=query", &data) assert.NoError(err) assert.NotEqual("", data.IP) wrongData := "" - err = JSONRequest("http://ip.jsontest.com/", &wrongData) + err = JSONRequest("http://ip-api.com/json/?fields=query", &wrongData) assert.Error(err) wrongData = ""