test

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const TOLERANCE time.Duration = 1000000000 * 60

TOLERANCE is the number of seconds that a CreatedAt or UpdatedAt time.Time is allowed to differ from the time at which it is checked.

As CreatedAt and UpdatedAt are automatically set by gorm, we need a tolerance here.

Variables

This section is empty.

Functions

func AssertHTTPStatus

func AssertHTTPStatus(t *testing.T, expected int, r *httptest.ResponseRecorder)

func DecodeResponse added in v0.10.0

func DecodeResponse(t *testing.T, r *httptest.ResponseRecorder, target interface{})

DecodeResponse decodes an HTTP response into a target struct.

func Request

func Request(t *testing.T, method, url, body string, headers ...map[string]string) httptest.ResponseRecorder

Request is a helper method to simplify making a HTTP request for tests.

Types

type APIResponse

type APIResponse struct {
	Links map[string]string
	Error string
}

Jump to

Keyboard shortcuts

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