Documentation
¶
Index ¶
- func AssertAction(t *testing.T, meta JSONAPIRespMeta, names ...string)
- func AssertAttr(t *testing.T, i interface{}, m map[string]interface{})
- func AssertGetOK(t *testing.T, path string, token string) (resp gorequest.Response, body string, errs []error)
- func AssertLink(t *testing.T, i interface{}, names ...string)
- func AssertNoAction(t *testing.T, meta JSONAPIRespMeta, names ...string)
- func AssertNoLink(t *testing.T, i interface{}, names ...string)
- func AssertStatusNotFound(t *testing.T, resp gorequest.Response)
- func AssertStatusOK(t *testing.T, resp gorequest.Response)
- func AssertStatusSuccess(t *testing.T, resp gorequest.Response)
- func AssertStatusUnauthorized(t *testing.T, resp gorequest.Response)
- func Request(method string, path string, token string) (req *gorequest.SuperAgent)
- type AuthRequester
- type JSONAPIManyResp
- type JSONAPIOneResp
- func Delete(t *testing.T, path string, token string) (gorequest.Response, *JSONAPIOneResp, []error)
- func Get(t *testing.T, path string, token string) (gorequest.Response, *JSONAPIOneResp, []error)
- func Patch(t *testing.T, path string, attrs map[string]interface{}, token string) (gorequest.Response, *JSONAPIOneResp, []error)
- func Post(t *testing.T, path string, attrs map[string]interface{}, token string) (gorequest.Response, *JSONAPIOneResp, []error)
- type JSONAPIRespData
- type JSONAPIRespMeta
- type Requester
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertAction ¶
func AssertAction(t *testing.T, meta JSONAPIRespMeta, names ...string)
AssertAction ...
func AssertAttr ¶
AssertAttr ...
func AssertGetOK ¶
func AssertGetOK(t *testing.T, path string, token string) (resp gorequest.Response, body string, errs []error)
AssertGetOK assert GET request is OK
func AssertNoAction ¶
func AssertNoAction(t *testing.T, meta JSONAPIRespMeta, names ...string)
AssertNoAction ...
func AssertNoLink ¶
AssertNoLink ...
func AssertStatusNotFound ¶
AssertStatusNotFound assert response status code is 404
func AssertStatusOK ¶
AssertStatusOK assert response status code is OK
func AssertStatusSuccess ¶
AssertStatusSuccess assert response code is success
func AssertStatusUnauthorized ¶
AssertStatusUnauthorized assert response status code is 401
Types ¶
type AuthRequester ¶
type AuthRequester struct {
Requester
// contains filtered or unexported fields
}
func NewAuthRequester ¶
func NewAuthRequester(t *testing.T, userId int) *AuthRequester
func (*AuthRequester) GetList ¶
func (r *AuthRequester) GetList(path string) (gorequest.Response, *JSONAPIManyResp, []error)
type JSONAPIManyResp ¶
type JSONAPIManyResp struct {
Data []JSONAPIRespData `json:"data"`
Meta JSONAPIRespMeta `json:"meta"`
Errors []*jsonapi.ErrorObject `json:"errors"`
Included []JSONAPIRespData
}
JSONAPIManyResp ...
type JSONAPIOneResp ¶
type JSONAPIOneResp struct {
Data JSONAPIRespData `json:"data"`
Errors []*jsonapi.ErrorObject `json:"errors"`
Included []JSONAPIRespData
}
JSONAPIOneResp ...
type JSONAPIRespData ¶
type JSONAPIRespData struct {
ID string
Type string
Attributes interface{} `json:"attributes"`
Meta JSONAPIRespMeta `json:"meta"`
Links interface{} `json:"links"`
Relationships interface{}
}
JSONAPIRespData ...
type JSONAPIRespMeta ¶
type JSONAPIRespMeta struct {
Actions []meta.JsonAPIAction
}
JSONAPIRespMeta ...
Click to show internal directories.
Click to hide internal directories.