From 631e0a2e204efd1c4686e6803714dc7874638125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Fri, 12 Jan 2018 18:16:51 -0800 Subject: [PATCH] Add integration test for export API endpoint --- Gopkg.lock | 2 +- integration_test.go | 19 +++++++++++++++++++ .../github.com/miniflux/miniflux-go/README.md | 15 +++++++++++++++ .../github.com/miniflux/miniflux-go/client.go | 17 +++++++++++++++++ .../miniflux/miniflux-go/miniflux.go | 18 ++++++++++-------- 5 files changed, 62 insertions(+), 9 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index afb479bb..e892b79b 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -41,7 +41,7 @@ branch = "master" name = "github.com/miniflux/miniflux-go" packages = ["."] - revision = "3d654932d84b6afdbd5e66b34b08392f62229e61" + revision = "887ba3b062946784f0e64edb1734f435beb204f9" [[projects]] name = "github.com/tdewolff/minify" diff --git a/integration_test.go b/integration_test.go index 0a53bef7..fb0a7854 100644 --- a/integration_test.go +++ b/integration_test.go @@ -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), "