summaryrefslogtreecommitdiff
path: root/spec/requests/api/v3/system_hooks_spec.rb
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-02-28 20:12:40 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-02-28 20:12:40 +0000
commit936215433dec7b1e5d67b980098b97a012219bae (patch)
treebac299b1b3bd2c5da5bf243b7332329c03c1ad80 /spec/requests/api/v3/system_hooks_spec.rb
parent6862e788e8b32196d750152c4657ea95d431e04f (diff)
parent05c8ec6cb85a3943b53cbd5757e7baea300dac68 (diff)
downloadgitlab-ce-936215433dec7b1e5d67b980098b97a012219bae.tar.gz
Merge branch 'master' into add-svg-loader
* master: (21 commits) Move `Group -> Members` to top-level, fix missing sub-nav for Subgroups Left align logo; increase max width of title Add newline to end of frontend.md. Clone nested objects from default data. Checks if key is present before accessing it Update CHANGELOG.md for 8.17.1 Document use of AirBnb js styleguide and eslint. Don't allow a project to be shared with an ancestor of the group it is in Fix access to projects shared with a nested group Ignore builds dir when run rubocop check Remove hidden-xs classes from last columns in environments and pipelines table. Transform pipelines table css to match structure of pipelines table Make environments table overflow Use exceptions for MergeService error handling Clarify when to create EE compatibility MR in code review process New runner API returns 204 Backport new behavior to CI API Backport API to V3 Update documentation Return 204 for delete endpoints API project create: Make name or path required Only create unmergeable todos once Put back the new project button ...
Diffstat (limited to 'spec/requests/api/v3/system_hooks_spec.rb')
-rw-r--r--spec/requests/api/v3/system_hooks_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/requests/api/v3/system_hooks_spec.rb b/spec/requests/api/v3/system_hooks_spec.rb
index da58efb6ebf..91038977c82 100644
--- a/spec/requests/api/v3/system_hooks_spec.rb
+++ b/spec/requests/api/v3/system_hooks_spec.rb
@@ -38,4 +38,20 @@ describe API::V3::SystemHooks, api: true do
end
end
end
+
+ describe "DELETE /hooks/:id" do
+ it "deletes a hook" do
+ expect do
+ delete v3_api("/hooks/#{hook.id}", admin)
+
+ expect(response).to have_http_status(200)
+ end.to change { SystemHook.count }.by(-1)
+ end
+
+ it 'returns 404 if the system hook does not exist' do
+ delete v3_api('/hooks/12345', admin)
+
+ expect(response).to have_http_status(404)
+ end
+ end
end