acceptancetest

package
v0.0.0-...-6b2a69b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2020 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertBadRequest

func AssertBadRequest(t *testing.T, method, path, body string)

func AssertMethodNotAllowed

func AssertMethodNotAllowed(t *testing.T, method, path string)

func ParseJSON

func ParseJSON(t *testing.T, data []byte) arguments.Argument

ParseJSON unmarshals JSON data as an Argument.

func ParseSample

func ParseSample(t *testing.T, unixPath string) arguments.Argument

ParseSample parses the JSON from the file at unixPath and returns it as an Argument.

func ReadFile

func ReadFile(t *testing.T, unixPath string) []byte

ReadFile reads the JSON data from unixPath.

Types

type App

type App struct {
	Emailer *Emailer
	// contains filtered or unexported fields
}

func NewApp

func NewApp(t *testing.T, cfg *AppConfig) *App

NewApp returns a bundle of utils useful for acceptance testing the app.

func (*App) AssertBadRequest

func (a *App) AssertBadRequest(method, path, body string)

func (*App) AssertNotFound

func (a *App) AssertNotFound(method, path string)

func (*App) Do

func (a *App) Do(req *http.Request) *httptest.ResponseRecorder

type AppConfig

type AppConfig struct {
	EmailerSucceeds bool
}

type Emailer

type Emailer struct {
	Welcomes       []*accounts.Account
	PasswordResets []*accounts.Account
	// contains filtered or unexported fields
}

func (*Emailer) SendReset

func (e *Emailer) SendReset(ctx context.Context, account accounts.Account) error

func (*Emailer) SendWelcome

func (e *Emailer) SendWelcome(ctx context.Context, account accounts.Account) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL