Documentation
¶
Overview ¶
Package authtest holds test helpers for applications that use the framework's auth: a Mailer that records the account lifecycle's messages instead of sending them, so a test can read the token a flow mailed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mailer ¶
type Mailer struct {
// Err, when set, is returned by Send, and the message is not recorded.
Err error
// contains filtered or unexported fields
}
Mailer is an auth.Mailer that records every message, for tests. Set Err to make Send fail. It is safe for concurrent use.
mail := &authtest.Mailer{}
app, _ := framework.New(framework.WithAuthMailer(mail), ...)
// register ada@example.com, then:
token := mail.Last("ada@example.com").Token