Add test to show a feed self-updating

master
Bel LaPointe 2018-10-10 13:39:17 -06:00
parent bee9ead960
commit b7cd1745b1
1 changed files with 8 additions and 1 deletions

View File

@ -82,7 +82,7 @@ func Test_Core(t *testing.T) {
{ {
method: "post", method: "post",
path: "api/feed", path: "api/feed",
body: `{"url":"` + rssserver.URL + `/feed", "refresh":"1m", "items":"[AB]", "content":"25"}`, body: `{"url":"` + rssserver.URL + `/feed", "refresh":"30m", "items":"[AB]", "content":"2"}`,
status: 200, status: 200,
post: func() { time.Sleep(time.Second * 10) }, post: func() { time.Sleep(time.Second * 10) },
}, },
@ -98,6 +98,13 @@ func Test_Core(t *testing.T) {
body: "http___127_0_0_1_" + strings.Split(rssserver.URL, ":")[2] + "_feed.20181010__itemB", body: "http___127_0_0_1_" + strings.Split(rssserver.URL, ":")[2] + "_feed.20181010__itemB",
status: 200, status: 200,
}, },
{
method: "post",
path: "api/feed",
body: `{"url":"` + rssserver.URL + `/feed", "refresh":"10s", "items":"[AB]", "content":"1"}`,
status: 200,
post: func() { time.Sleep(time.Second * 15) },
},
} }
for _, c := range cases { for _, c := range cases {
c.method = strings.ToUpper(c.method) c.method = strings.ToUpper(c.method)