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 /me endpoint

This commit is contained in:
Frédéric Guillot 2018-05-14 18:52:12 -07:00
parent e81e4f0ac3
commit 9554d0bd53
4 changed files with 43 additions and 9 deletions

View file

@ -44,6 +44,22 @@ func TestWithWrongCredentials(t *testing.T) {
}
}
func TestGetCurrentLoggedUser(t *testing.T) {
client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
user, err := client.Me()
if err != nil {
t.Fatal(err)
}
if user.ID == 0 {
t.Fatalf(`Invalid userID, got %q`, user.ID)
}
if user.Username != testAdminUsername {
t.Fatalf(`Invalid username, got %q`, user.Username)
}
}
func TestGetUsers(t *testing.T) {
client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword)
users, err := client.Users()