diff options
author | Frédéric Guillot <fred@miniflux.net> | 2017-11-25 15:38:43 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2017-11-25 15:38:43 -0800 |
commit | db77e551191b8f60ab657b549bc5499b9266cf69 (patch) | |
tree | 111aa08430e0678e3c510d1983e4690837e57742 /integration_test.go | |
parent | f644f2580b25acbeed880f12277473596457307e (diff) |
Add integration test for discover endpoint
Diffstat (limited to 'integration_test.go')
-rw-r--r-- | integration_test.go | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/integration_test.go b/integration_test.go index 2690dbb..9d7002d 100644 --- a/integration_test.go +++ b/integration_test.go @@ -466,7 +466,6 @@ func TestDeleteCategory(t *testing.T) { func TestCannotDeleteCategoryOfAnotherUser(t *testing.T) { username := getRandomUsername() client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword) - categories, err := client.Categories() if err != nil { t.Fatal(err) @@ -484,6 +483,30 @@ func TestCannotDeleteCategoryOfAnotherUser(t *testing.T) { } } +func TestDiscoverSubscriptions(t *testing.T) { + client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword) + subscriptions, err := client.Discover("https://miniflux.net") + if err != nil { + t.Fatal(err) + } + + if len(subscriptions) != 1 { + t.Fatalf(`Invalid number of subscriptions, got "%v" instead of "%v"`, len(subscriptions), 2) + } + + if subscriptions[0].Title != "Feed" { + t.Fatalf(`Invalid userID, got "%v" instead of "%v"`, subscriptions[0].Title, "Feed") + } + + if subscriptions[0].Type != "atom" { + t.Fatalf(`Invalid userID, got "%v" instead of "%v"`, subscriptions[0].Type, "atom") + } + + if subscriptions[0].URL != "https://miniflux.net/feed" { + t.Fatalf(`Invalid userID, got "%v" instead of "%v"`, subscriptions[0].URL, "https://miniflux.net/feed") + } +} + func getRandomUsername() string { rand.Seed(time.Now().UnixNano()) var suffix []string |