From 822766e7809a1e6767420846819d0b2e54dafe54 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Tue, 9 Oct 2018 19:37:22 -0600 Subject: [PATCH] Get single item test --- main_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main_test.go b/main_test.go index 477f06d..10abeec 100644 --- a/main_test.go +++ b/main_test.go @@ -56,6 +56,12 @@ func Test_Core(t *testing.T) { body: "https://utw.me/feed/", status: 200, }, + { + method: "get", + path: "api/feed/item", + body: "https___utw_me_feed_.20180108_https___utw_me_2018_01_08_fate_apocrypha_25_", + status: 200, + }, } for _, c := range cases { c.method = strings.ToUpper(c.method) @@ -82,8 +88,10 @@ func Test_Core(t *testing.T) { t.Errorf("cannot %s to %s: %v", c.method, loc.String(), err) } else if resp.StatusCode != c.status { t.Errorf("wrong %s status to %s: %v, expected %v", c.method, loc.String(), resp.StatusCode, c.status) - } else if _, err := ioutil.ReadAll(resp.Body); err != nil { + } else if b, err := ioutil.ReadAll(resp.Body); err != nil { t.Errorf("cannot read body on %s to %s: %v", c.method, loc.String(), err) + } else { + t.Logf("resp body: %s", b) } if c.post != nil { c.post()