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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
f0e41709
Commit
f0e41709
authored
Feb 20, 2013
by
Sebastian Ziebell
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into fixes/api
Conflicts: spec/requests/api/projects_spec.rb
parents
512d826c
ba1a453e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
7 deletions
+6
-7
doc/api/projects.md
doc/api/projects.md
+1
-1
lib/api/projects.rb
lib/api/projects.rb
+2
-2
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+3
-4
No files found.
doc/api/projects.md
View file @
f0e41709
...
@@ -354,7 +354,7 @@ Removes a hook from project. This is an idempotent method and can be called mult
...
@@ -354,7 +354,7 @@ Removes a hook from project. This is an idempotent method and can be called mult
Either the hook is available or not.
Either the hook is available or not.
```
```
DELETE /projects/:id/hooks
DELETE /projects/:id/hooks
/:hook_id
```
```
Parameters:
Parameters:
...
...
lib/api/projects.rb
View file @
f0e41709
...
@@ -244,8 +244,8 @@ module Gitlab
...
@@ -244,8 +244,8 @@ module Gitlab
# id (required) - The ID of a project
# id (required) - The ID of a project
# 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
# 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
bad_request!
(
:hook_id
)
unless
params
.
has_key?
:hook_id
bad_request!
(
:hook_id
)
unless
params
.
has_key?
:hook_id
...
...
spec/requests/api/projects_spec.rb
View file @
f0e41709
...
@@ -384,7 +384,7 @@ describe Gitlab::API do
...
@@ -384,7 +384,7 @@ describe Gitlab::API do
it
"should add hook to project"
do
it
"should add hook to project"
do
expect
{
expect
{
post
api
(
"/projects/
#{
project
.
id
}
/hooks"
,
user
),
post
api
(
"/projects/
#{
project
.
id
}
/hooks"
,
user
),
"url"
=>
"http://example.com"
url:
"http://example.com"
}.
to
change
{
project
.
hooks
.
count
}.
by
(
1
)
}.
to
change
{
project
.
hooks
.
count
}.
by
(
1
)
response
.
status
.
should
==
201
response
.
status
.
should
==
201
end
end
...
@@ -424,11 +424,10 @@ describe Gitlab::API do
...
@@ -424,11 +424,10 @@ 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
),
delete
api
(
"/projects/
#{
project
.
id
}
/hooks/
#{
hook
.
id
}
"
,
user
)
hook_id:
hook
.
id
}.
to
change
{
project
.
hooks
.
count
}.
by
(
-
1
)
}.
to
change
{
project
.
hooks
.
count
}.
by
(
-
1
)
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