photoprism/internal/api/feedback_test.go

17 lines
403 B
Go
Raw Normal View History

2020-10-19 16:11:42 +02:00
package api
import (
"testing"
2020-11-21 18:08:41 +01:00
"github.com/stretchr/testify/assert"
2020-10-19 16:11:42 +02:00
)
func TestSendFeedback(t *testing.T) {
t.Run("not available in public mode", func(t *testing.T) {
app, router, _ := NewApiTest()
SendFeedback(router)
r := PerformRequestWithBody(app, "POST", "/api/v1/feedback", `{"Subject": "Send feedback from unit test", "Message": "Test message"}`)
assert.Equal(t, 403, r.Code)
})
}