photoprism/internal/api/user_test.go
2020-07-14 18:08:48 +02:00

16 lines
367 B
Go

package api
import (
"github.com/stretchr/testify/assert"
"net/http"
"testing"
)
func TestChangePassword(t *testing.T) {
t.Run("not existing person", func(t *testing.T) {
app, router, _ := NewApiTest()
ChangePassword(router)
r := PerformRequestWithBody(app, "PUT", "/api/v1/users/xxx/password", `{}`)
assert.Equal(t, http.StatusForbidden, r.Code)
})
}