From 37f229c7358a48c6a9af3481927e9e4faee17e3d Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Wed, 2 Nov 2016 13:24:24 +0100 Subject: Update docs and test description [ci skip] --- doc/api/system_hooks.md | 8 ++++---- spec/requests/api/system_hooks_spec.rb | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/api/system_hooks.md b/doc/api/system_hooks.md index 569831af540..efd23d514bc 100644 --- a/doc/api/system_hooks.md +++ b/doc/api/system_hooks.md @@ -51,10 +51,10 @@ POST /hooks | Attribute | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `url` | string | yes | The hook URL | -| token | string | no | The token to validate payloads | -| push_events | boolean | no | When true, the hook will fire on push events | -| tag_push_events | boolean | no | When true, the hook will fire on new tags being pushed | -| enable_ssl_verification | boolean | no | Do SSL verification when triggering the hook | +| `token` | string | no | Secret token to validate received payloads; this will not be returned in the response | +| `push_events` | boolean | no | When true, the hook will fire on push events | +| `tag_push_events` | boolean | no | When true, the hook will fire on new tags being pushed | +| `enable_ssl_verification` | boolean | no | Do SSL verification when triggering the hook | Example request: diff --git a/spec/requests/api/system_hooks_spec.rb b/spec/requests/api/system_hooks_spec.rb index 55567941e08..f685a3685e6 100644 --- a/spec/requests/api/system_hooks_spec.rb +++ b/spec/requests/api/system_hooks_spec.rb @@ -48,6 +48,7 @@ describe API::API, api: true do it "responds with 400 if url not given" do post api("/hooks", admin) + expect(response).to have_http_status(400) end @@ -57,7 +58,7 @@ describe API::API, api: true do end.not_to change { SystemHook.count } end - it 'allows the events to be selected' do + it 'sets default values for events' do post api('/hooks', admin), url: 'http://mep.mep', enable_ssl_verification: true expect(response).to have_http_status(201) -- cgit v1.2.1