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
Kazuhiko Shiozaki
gitlab-ce
Commits
d0ebdedf
Commit
d0ebdedf
authored
Oct 28, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mr-vinn/gitlab-ce-api-project-delete'
parents
05f19392
576a80e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
lib/api/projects.rb
lib/api/projects.rb
+1
-1
spec/features/projects_spec.rb
spec/features/projects_spec.rb
+9
-0
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+5
-0
No files found.
lib/api/projects.rb
View file @
d0ebdedf
...
@@ -178,7 +178,7 @@ module API
...
@@ -178,7 +178,7 @@ module API
# DELETE /projects/:id
# DELETE /projects/:id
delete
":id"
do
delete
":id"
do
authorize!
:remove_project
,
user_project
authorize!
:remove_project
,
user_project
user_project
.
destroy
::
Projects
::
DestroyService
.
new
(
user_project
,
current_user
,
{}).
execute
end
end
# Mark this project as forked from another
# Mark this project as forked from another
...
...
spec/features/projects_spec.rb
View file @
d0ebdedf
...
@@ -17,5 +17,14 @@ describe "Projects", feature: true do
...
@@ -17,5 +17,14 @@ describe "Projects", feature: true do
click_button
'Confirm'
click_button
'Confirm'
}.
to
change
{
Project
.
count
}.
by
(
-
1
)
}.
to
change
{
Project
.
count
}.
by
(
-
1
)
end
end
it
'should delete the project from the database and disk'
do
expect
(
GitlabShellWorker
).
to
(
receive
(
:perform_async
).
with
(
:remove_repository
,
/
#{
@project
.
path_with_namespace
}
/
)
).
twice
expect
{
click_link
"Remove project"
}.
to
change
{
Project
.
count
}.
by
(
-
1
)
end
end
end
end
end
spec/requests/api/projects_spec.rb
View file @
d0ebdedf
...
@@ -632,6 +632,11 @@ describe API::API, api: true do
...
@@ -632,6 +632,11 @@ describe API::API, api: true do
describe
"DELETE /projects/:id"
do
describe
"DELETE /projects/:id"
do
context
"when authenticated as user"
do
context
"when authenticated as user"
do
it
"should remove project"
do
it
"should remove project"
do
expect
(
GitlabShellWorker
).
to
(
receive
(
:perform_async
).
with
(
:remove_repository
,
/
#{
project
.
path_with_namespace
}
/
)
).
twice
delete
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
delete
api
(
"/projects/
#{
project
.
id
}
"
,
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