Use 201 status code where appropriate for APIv4 (#5903)

This commit is contained in:
Joram Wilander
2017-03-31 09:56:20 -04:00
committed by Christopher Speller
parent 4e224c2996
commit 5f6d50bff1
11 changed files with 21 additions and 0 deletions

View File

@@ -442,6 +442,15 @@ func CheckNoError(t *testing.T, resp *model.Response) {
}
}
func CheckCreatedStatus(t *testing.T, resp *model.Response) {
if resp.StatusCode != http.StatusCreated {
debug.PrintStack()
t.Log("actual: " + strconv.Itoa(resp.StatusCode))
t.Log("expected: " + strconv.Itoa(http.StatusCreated))
t.Fatal("wrong status code")
}
}
func CheckForbiddenStatus(t *testing.T, resp *model.Response) {
if resp.Error == nil {
debug.PrintStack()