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:
parent
e81e4f0ac3
commit
9554d0bd53
4 changed files with 43 additions and 9 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue