test_helpers

package
v0.0.0-...-5b323e4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CassettePath

func CassettePath(cassetteName string) string

func CreateMultipartRequestInfo

func CreateMultipartRequestInfo(filePath string, contentType string) (http.Header, *bytes.Buffer)

func DeleteRedisJobs

func DeleteRedisJobs()

func GetBody

func GetBody(response *httptest.ResponseRecorder) string

func GetFlash

func GetFlash(cookies []*http.Cookie) *web.FlashData

func GetJSONBody

func GetJSONBody(response *httptest.ResponseRecorder) map[string]interface{}

func GetMultipartAttributesFromFile

func GetMultipartAttributesFromFile(filePath string, contentType string) (multipart.File, *multipart.FileHeader, error)

func GetWorkerClient

func GetWorkerClient() *work.Client

func MakeAuthenticatedRequest

func MakeAuthenticatedRequest(method string, url string, headers http.Header, body io.Reader, userInfo *UserInfo) *httptest.ResponseRecorder

MakeAuthenticatedRequest makes a HTTP request with authenticated user and returns response

func MakeRequest

func MakeRequest(method string, url string, body io.Reader) *httptest.ResponseRecorder

MakeRequest makes a HTTP request and returns response

func MakeRequestWithBasicAuthentication

func MakeRequestWithBasicAuthentication(method string, url string, body io.Reader) *httptest.ResponseRecorder

MakeRequest makes a HTTP request with basic authentication and returns response

func TruncateTables

func TruncateTables(tables ...string)

Types

type UserInfo

type UserInfo struct {
	Id       uint
	Email    string
	Password string
	Token    *models.Token
}

Jump to

Keyboard shortcuts

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