Skip to content

Commit

Permalink
Add test for unsupported content type error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanh committed Dec 2, 2019
1 parent a99abd4 commit 1110f82
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ env: HOOK_head_commit.timestamp=2013-03-12T08:14:29-07:00
// Check logs
{"static params should pass", "static-params-ok", nil, `{}`, false, http.StatusOK, "arg: passed\n", `(?s)command output: arg: passed`},
{"command with space logs warning", "warn-on-space", nil, `{}`, false, http.StatusInternalServerError, "Error occurred while executing the hook's command. Please check your logs for more details.", `(?s)unable to locate command.*use 'pass[-]arguments[-]to[-]command' to specify args`},
{"unsupported content type error", "github", map[string]string{"Content-Type": "nonexistent/format"}, `{}`, false, http.StatusBadRequest, `Hook rules were not satisfied.`, `(?s)error parsing body payload due to unsupported content type header:`},
}

// buffer provides a concurrency-safe bytes.Buffer to tests above.
Expand Down

0 comments on commit 1110f82

Please sign in to comment.