diff options
author | Frédéric Guillot <fred@miniflux.net> | 2018-05-14 18:52:12 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2018-05-14 18:52:12 -0700 |
commit | 9554d0bd53e02e6844e5e8811c3e8557fd0b7d17 (patch) | |
tree | 6b280f89d69e19501feda1c794b55b3a58d2f3b1 /integration_test.go | |
parent | e81e4f0ac34569f9ab3f05b33fb05125c1d52026 (diff) |
Add integration test for /me endpoint
Diffstat (limited to 'integration_test.go')
-rw-r--r-- | integration_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/integration_test.go b/integration_test.go index 88ecfa6..a26fe57 100644 --- a/integration_test.go +++ b/integration_test.go @@ -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() |