Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
78ff99a7
Commit
78ff99a7
authored
May 06, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3856 from NARKOZ/delete-hook-api
fix API route to delete project hook
parents
8b65d069
77d0e41d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
lib/api/projects.rb
lib/api/projects.rb
+1
-1
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+4
-4
No files found.
lib/api/projects.rb
View file @
78ff99a7
...
@@ -274,7 +274,7 @@ module Gitlab
...
@@ -274,7 +274,7 @@ module Gitlab
# hook_id (required) - The ID of hook to delete
# hook_id (required) - The ID of hook to delete
# Example Request:
# Example Request:
# DELETE /projects/:id/hooks/:hook_id
# DELETE /projects/:id/hooks/:hook_id
delete
":id/hooks"
do
delete
":id/hooks
/:hook_id
"
do
authorize!
:admin_project
,
user_project
authorize!
:admin_project
,
user_project
required_attributes!
[
:hook_id
]
required_attributes!
[
:hook_id
]
...
...
spec/requests/api/projects_spec.rb
View file @
78ff99a7
...
@@ -467,21 +467,21 @@ describe Gitlab::API do
...
@@ -467,21 +467,21 @@ describe Gitlab::API do
end
end
end
end
describe
"DELETE /projects/:id/hooks"
do
describe
"DELETE /projects/:id/hooks
/:hook_id
"
do
it
"should delete hook from project"
do
it
"should delete hook from project"
do
expect
{
expect
{
delete
api
(
"/projects/
#{
project
.
id
}
/hooks
"
,
user
),
hook_id:
hook
.
id
delete
api
(
"/projects/
#{
project
.
id
}
/hooks
/
#{
hook
.
id
}
"
,
user
)
}.
to
change
{
project
.
hooks
.
count
}.
by
(
-
1
)
}.
to
change
{
project
.
hooks
.
count
}.
by
(
-
1
)
response
.
status
.
should
==
200
response
.
status
.
should
==
200
end
end
it
"should return success when deleting hook"
do
it
"should return success when deleting hook"
do
delete
api
(
"/projects/
#{
project
.
id
}
/hooks
"
,
user
),
hook_id:
hook
.
id
delete
api
(
"/projects/
#{
project
.
id
}
/hooks
/
#{
hook
.
id
}
"
,
user
)
response
.
status
.
should
==
200
response
.
status
.
should
==
200
end
end
it
"should return success when deleting non existent hook"
do
it
"should return success when deleting non existent hook"
do
delete
api
(
"/projects/
#{
project
.
id
}
/hooks
"
,
user
),
hook_id:
42
delete
api
(
"/projects/
#{
project
.
id
}
/hooks
/42"
,
user
)
response
.
status
.
should
==
200
response
.
status
.
should
==
200
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment