summaryrefslogtreecommitdiffstats
path: root/api4/apitestlib.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-02-21 19:42:34 -0500
committerGitHub <noreply@github.com>2017-02-21 19:42:34 -0500
commit69cac604e09c139845d2f63ac95fb702fb5a9fe1 (patch)
tree611920333a5d55f5db0cca43bd3cb5cf1bee30e8 /api4/apitestlib.go
parentb61115df55ea6eba9976e561a8b39bf5a297fcc9 (diff)
downloadchat-69cac604e09c139845d2f63ac95fb702fb5a9fe1.tar.gz
chat-69cac604e09c139845d2f63ac95fb702fb5a9fe1.tar.bz2
chat-69cac604e09c139845d2f63ac95fb702fb5a9fe1.zip
Implement create and get incoming webhook endpoints for APIv4 (#5407)
* Implement POST /hooks/incoming endpoint for APIv4 * Implement GET /hooks/incoming endpoint for APIv4 * Updates per feedback
Diffstat (limited to 'api4/apitestlib.go')
-rw-r--r--api4/apitestlib.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/api4/apitestlib.go b/api4/apitestlib.go
index bb5ee1594..d77438e04 100644
--- a/api4/apitestlib.go
+++ b/api4/apitestlib.go
@@ -422,6 +422,21 @@ func CheckBadRequestStatus(t *testing.T, resp *model.Response) {
}
}
+func CheckNotImplementedStatus(t *testing.T, resp *model.Response) {
+ if resp.Error == nil {
+ debug.PrintStack()
+ t.Fatal("should have errored with status:" + strconv.Itoa(http.StatusNotImplemented))
+ return
+ }
+
+ if resp.StatusCode != http.StatusNotImplemented {
+ debug.PrintStack()
+ t.Log("actual: " + strconv.Itoa(resp.StatusCode))
+ t.Log("expected: " + strconv.Itoa(http.StatusNotImplemented))
+ t.Fatal("wrong status code")
+ }
+}
+
func CheckErrorMessage(t *testing.T, resp *model.Response, errorId string) {
if resp.Error == nil {
debug.PrintStack()