make http return code for mismatched rules configurable

Signed-off-by: Mathias Merscher <Mathias.Merscher@dg-i.net>
This commit is contained in:
Mathias Merscher 2017-02-10 12:32:11 +01:00
parent 8226d5e50f
commit ddb1f2441a
4 changed files with 20 additions and 1 deletions

View file

@ -515,5 +515,10 @@ env: HOOK_head_commit.timestamp=2013-03-12T08:14:29-07:00
`,
},
{"empty payload", "github", nil, `{}`, false, http.StatusOK, `Hook rules were not satisfied.`},
// test with custom return code
{"empty payload", "github", nil, `{}`, false, http.StatusBadRequest, `Hook rules were not satisfied.`},
// test with custom invalid http code, should default to 200 OK
{"empty payload", "bitbucket", nil, `{}`, false, http.StatusOK, `Hook rules were not satisfied.`},
// test with no configured http return code, should default to 200 OK
{"empty payload", "gitlab", nil, `{}`, false, http.StatusOK, `Hook rules were not satisfied.`},
}