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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
4416be54
Commit
4416be54
authored
Oct 09, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API: specs for remove project
parent
c8e7d6df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+38
-0
No files found.
spec/requests/api/projects_spec.rb
View file @
4416be54
...
...
@@ -730,4 +730,42 @@ describe API::API do
end
end
end
describe
"DELETE /projects/:id"
do
context
"when authenticated as user"
do
it
"should remove project"
do
delete
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
response
.
status
.
should
==
200
end
it
"should not remove a project if not an owner"
do
user3
=
create
(
:user
)
project
.
team
<<
[
user3
,
:developer
]
delete
api
(
"/projects/
#{
project
.
id
}
"
,
user3
)
response
.
status
.
should
==
403
end
it
"should not remove a non existing project"
do
delete
api
(
"/projects/1328"
,
user
)
response
.
status
.
should
==
404
end
it
"should not remove a project not attached to user"
do
delete
api
(
"/projects/
#{
project
.
id
}
"
,
user2
)
response
.
status
.
should
==
404
end
end
context
"when authenticated as admin"
do
it
"should remove any existing project"
do
delete
api
(
"/projects/
#{
project
.
id
}
"
,
admin
)
response
.
status
.
should
==
200
end
it
"should not remove a non existing project"
do
delete
api
(
"/projects/1328"
,
admin
)
response
.
status
.
should
==
404
end
end
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