1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Add integration test for export API endpoint

This commit is contained in:
Frédéric Guillot 2018-01-12 18:16:51 -08:00
parent 4aec2453f4
commit 631e0a2e20
5 changed files with 62 additions and 9 deletions

View file

@ -634,6 +634,25 @@ func TestCreateFeedWithInexistingCategory(t *testing.T) {
}
}
func TestExport(t *testing.T) {
username := getRandomUsername()
client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
_, err := client.CreateUser(username, testStandardPassword, false)
if err != nil {
t.Fatal(err)
}
client = miniflux.NewClient(testBaseURL, username, testStandardPassword)
output, err := client.Export()
if err != nil {
t.Fatal(err)
}
if !strings.HasPrefix(string(output), "<?xml") {
t.Fatalf(`Invalid OPML export, got "%s"`, string(output))
}
}
func TestUpdateFeed(t *testing.T) {
username := getRandomUsername()
client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)