expecthttp

package
v0.0.0-...-2d572df Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentType

func ContentType(t *testing.T, expected string, rr *httptest.ResponseRecorder)

ContentType expects the given response to have the given Content-Type header

func Header(t *testing.T, key string, val string, headers hasHeaders)

Header expects the given response to contain the given header

func JSONBody

func JSONBody(t *testing.T, expected interface{}, body hasBytes)

JSONBody expects the response body to match the marshaled struct given

func Ok

func Ok(t *testing.T, rr *httptest.ResponseRecorder)

Ok expects the given response to have status code OK (200)

func Status

func Status(t *testing.T, expected int, rr *httptest.ResponseRecorder)

Status expects the given status codes to match

func StringBody

func StringBody(t *testing.T, expected string, rr *httptest.ResponseRecorder)

StringBody expect the response body to match the given string

Types

This section is empty.

Jump to

Keyboard shortcuts

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