mirror of
https://github.com/miniflux/v2.git
synced 2025-08-06 17:41:00 +00:00
feat: populate feed description automatically
This commit is contained in:
parent
5920e02562
commit
8142268799
9 changed files with 83 additions and 11 deletions
|
@ -41,6 +41,10 @@ func TestParseJsonFeedVersion1(t *testing.T) {
|
|||
t.Errorf("Incorrect title, got: %s", feed.Title)
|
||||
}
|
||||
|
||||
if feed.Description != "" {
|
||||
t.Errorf("Incorrect description, got: %s", feed.Description)
|
||||
}
|
||||
|
||||
if feed.FeedURL != "https://example.org/feed.json" {
|
||||
t.Errorf("Incorrect feed URL, got: %s", feed.FeedURL)
|
||||
}
|
||||
|
@ -90,6 +94,26 @@ func TestParseJsonFeedVersion1(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestParseFeedWithDescription(t *testing.T) {
|
||||
data := `{
|
||||
"version": "https://jsonfeed.org/version/1",
|
||||
"title": "My Example Feed",
|
||||
"description": "This is a sample feed description.",
|
||||
"home_page_url": "https://example.org/",
|
||||
"feed_url": "https://example.org/feed.json",
|
||||
"items": []
|
||||
}`
|
||||
|
||||
feed, err := Parse("https://example.org/feed.json", bytes.NewBufferString(data))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if feed.Description != "This is a sample feed description." {
|
||||
t.Errorf("Incorrect description, got: %s", feed.Description)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParsePodcast(t *testing.T) {
|
||||
data := `{
|
||||
"version": "https://jsonfeed.org/version/1",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue