photoprism/internal/api/user_test.go
2020-11-21 18:08:41 +01:00

17 lines
366 B
Go

package api
import (
"net/http"
"testing"
"github.com/stretchr/testify/assert"
)
func TestChangePassword(t *testing.T) {
t.Run("not existing user", 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)
})
}