Files
descrybe/apps/api/internal/httpapi/company_invite_test.go
T

21 lines
473 B
Go
Raw Normal View History

package httpapi
2026-08-17 00:53:51 +02:00
import (
"strings"
"testing"
2026-08-17 00:53:51 +02:00
"github.com/descrybe/descrybe-v2/apps/api/internal/mail"
)
func TestInviteAcceptURLAlwaysShareable(t *testing.T) {
t.Parallel()
2026-08-17 00:53:51 +02:00
url := mail.AcceptInviteURL("https://app.example.com/", "tok_abc")
2026-08-17 21:20:45 +02:00
want := "https://app.example.com/accept-invite#token=tok_abc"
2026-08-17 00:53:51 +02:00
if url != want {
t.Fatalf("AcceptInviteURL = %q want %q", url, want)
}
2026-08-17 00:53:51 +02:00
if strings.Contains(url, "mailto:") {
t.Fatal("invite URL must not be mailto")
}
}