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
Léo-Paul Géneau
gitlab-ce
Commits
1868b8af
Commit
1868b8af
authored
Feb 03, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the tests to spec/services/projects/destroy_service_spec.rb
parent
aaf382d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
16 deletions
+10
-16
spec/services/projects/destroy_service_spec.rb
spec/services/projects/destroy_service_spec.rb
+2
-1
spec/workers/project_destroy_worker_spec.rb
spec/workers/project_destroy_worker_spec.rb
+8
-15
No files found.
spec/services/projects/destroy_service_spec.rb
View file @
1868b8af
...
...
@@ -47,8 +47,9 @@ describe Projects::DestroyService, services: true do
it_behaves_like
'deleting the project'
end
context
'delete with pipeline'
do
# which has optimistic locking
context
'delete with pipeline
and build
'
do
# which has optimistic locking
let!
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let!
(
:build
)
{
create
(
:ci_build
,
:artifacts
,
pipeline:
pipeline
)
}
before
do
expect
(
project
).
to
receive
(
:destroy!
).
and_call_original
...
...
spec/workers/project_destroy_worker_spec.rb
View file @
1868b8af
require
'spec_helper'
describe
ProjectDestroyWorker
do
let
(
:project
)
{
create
(
:project
,
pending_delete:
true
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:path
)
{
project
.
repository
.
path_to_repo
}
subject
{
ProjectDestroyWorker
.
new
}
describe
'#perform'
do
context
'with pipelines and builds'
do
let!
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let!
(
:build
)
{
create
(
:ci_build
,
:artifacts
,
pipeline:
pipeline
)
}
describe
"#perform"
do
it
"deletes the project"
do
subject
.
perform
(
project
.
id
,
project
.
owner
.
id
,
{})
it
'deletes the project along with pipelines and builds'
do
subject
.
perform
(
project
.
id
,
project
.
owner
.
id
,
{})
expect
(
Project
.
all
).
not_to
include
(
project
)
expect
(
Ci
::
Pipeline
.
all
).
not_to
include
(
pipeline
)
expect
(
Ci
::
Build
.
all
).
not_to
include
(
build
)
expect
(
Dir
.
exist?
(
path
)).
to
be_falsey
end
expect
(
Project
.
all
).
not_to
include
(
project
)
expect
(
Dir
.
exist?
(
path
)).
to
be_falsey
end
it
'deletes the project but skips repo deletion'
do
subject
.
perform
(
project
.
id
,
project
.
owner
.
id
,
{
'skip_repo'
=>
true
})
it
"deletes the project but skips repo deletion"
do
subject
.
perform
(
project
.
id
,
project
.
owner
.
id
,
{
"skip_repo"
=>
true
})
expect
(
Project
.
all
).
not_to
include
(
project
)
expect
(
Dir
.
exist?
(
path
)).
to
be_truthy
...
...
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