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
4d3eac1a
Commit
4d3eac1a
authored
Jun 22, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added specs for probe_repository_storage
parent
b5137acd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
spec/workers/geo_repository_destroy_worker_spec.rb
spec/workers/geo_repository_destroy_worker_spec.rb
+14
-4
No files found.
spec/workers/geo_repository_destroy_worker_spec.rb
View file @
4d3eac1a
...
...
@@ -6,10 +6,6 @@ describe GeoRepositoryDestroyWorker do
let!
(
:remove_path
)
{
path
.
sub
(
/\.git\Z/
,
"+
#{
project
.
id
}
+deleted.git"
)
}
let
(
:perform!
)
{
subject
.
perform
(
project
.
id
,
project
.
name
,
path
)
}
before
do
project
.
delete
end
it
'delegates project removal to Projects::DestroyService'
do
expect_any_instance_of
(
::
Projects
::
DestroyService
).
to
receive
(
:geo_replicate
)
...
...
@@ -17,6 +13,10 @@ describe GeoRepositoryDestroyWorker do
end
context
'sidekiq execution'
do
before
do
project
.
delete
end
it
'removes the repository from disk'
do
expect
(
project
.
gitlab_shell
.
exists?
(
project
.
repository_storage_path
,
path
+
'.git'
)).
to
be_truthy
...
...
@@ -26,4 +26,14 @@ describe GeoRepositoryDestroyWorker do
expect
(
project
.
gitlab_shell
.
exists?
(
project
.
repository_storage_path
,
remove_path
+
'.git'
)).
to
be_falsey
end
end
describe
'#probe_repository_storage'
do
it
'returns a repository_storage when repository can be found'
do
expect
(
subject
.
send
(
:probe_repository_storage
,
project
.
path_with_namespace
)).
to
eq
(
'default'
)
end
it
'returns nil when repository cannot be found in any existing repository_storage'
do
expect
(
subject
.
send
(
:probe_repository_storage
,
'nonexistent/project'
)).
to
eq
(
nil
)
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