diff options
author | Gauvain Pocentek <gauvain.pocentek@objectif-libre.com> | 2016-10-23 09:46:39 +0200 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-11-01 10:41:39 +0000 |
commit | c85c146aa2042710caddc6666ce8f9e07b2fe5ca (patch) | |
tree | c091ac5ec84f1af498be9a1246ee0e2555fe1699 /spec/requests/api/project_hooks_spec.rb | |
parent | 266fcfb1935c8aa8c6ac3d2ae71530c441b08675 (diff) | |
download | gitlab-ce-c85c146aa2042710caddc6666ce8f9e07b2fe5ca.tar.gz |
Add support for token attr in project hooks API
The UI allows to define a token to validate payload on the target URL,
this patch adds the feature to the API.
Diffstat (limited to 'spec/requests/api/project_hooks_spec.rb')
-rw-r--r-- | spec/requests/api/project_hooks_spec.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/requests/api/project_hooks_spec.rb b/spec/requests/api/project_hooks_spec.rb index cfcdcad74cd..53113c62996 100644 --- a/spec/requests/api/project_hooks_spec.rb +++ b/spec/requests/api/project_hooks_spec.rb @@ -36,6 +36,7 @@ describe API::API, 'ProjectHooks', api: true do expect(json_response.first['pipeline_events']).to eq(true) expect(json_response.first['wiki_page_events']).to eq(true) expect(json_response.first['enable_ssl_verification']).to eq(true) + expect(json_response.first['token']).to eq('S3cr3t') end end @@ -62,6 +63,7 @@ describe API::API, 'ProjectHooks', api: true do expect(json_response['pipeline_events']).to eq(hook.pipeline_events) expect(json_response['wiki_page_events']).to eq(hook.wiki_page_events) expect(json_response['enable_ssl_verification']).to eq(hook.enable_ssl_verification) + expect(json_response['token']).to eq(hook.token) end it "returns a 404 error if hook id is not available" do @@ -99,6 +101,7 @@ describe API::API, 'ProjectHooks', api: true do expect(json_response['pipeline_events']).to eq(false) expect(json_response['wiki_page_events']).to eq(false) expect(json_response['enable_ssl_verification']).to eq(true) + expect(json_response['token']).to eq('S3cr3t') end it "returns a 400 error if url not given" do @@ -127,6 +130,7 @@ describe API::API, 'ProjectHooks', api: true do expect(json_response['pipeline_events']).to eq(hook.pipeline_events) expect(json_response['wiki_page_events']).to eq(hook.wiki_page_events) expect(json_response['enable_ssl_verification']).to eq(hook.enable_ssl_verification) + expect(json_response['token']).to eq(hook.token) end it "returns 404 error if hook id not found" do |