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
799c27b3
Commit
799c27b3
authored
Aug 09, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for Geo::ScheduleWikiRepoUpdateService
parent
907d35e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
spec/services/geo/schedule_wiki_repo_update_service_spec.rb
spec/services/geo/schedule_wiki_repo_update_service_spec.rb
+40
-0
No files found.
spec/services/geo/schedule_wiki_repo_update_service_spec.rb
0 → 100644
View file @
799c27b3
require
'spec_helper'
describe
Geo
::
ScheduleWikiRepoUpdateService
do
describe
'#execute'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:project_1
)
{
create
(
:project
)
}
let
(
:project_2
)
{
create
(
:project
,
group:
group
)
}
let
(
:projects
)
do
[
{
'id'
=>
project_1
.
id
,
'clone_url'
=>
'git@example.com:mike/diaspora.git'
},
{
'id'
=>
project_2
.
id
,
'clone_url'
=>
'git@example.com:asd/vim.git'
}
]
end
subject
{
described_class
.
new
(
projects
)
}
it
"enqueues a batch of IDs of wiki's projects to have their wiki repositories updated"
do
expect
(
GeoWikiRepositoryUpdateWorker
).
to
receive
(
:perform_async
)
.
once
.
with
(
project_1
.
id
,
'git@example.com:mike/diaspora.git'
).
and_return
(
spy
)
expect
(
GeoWikiRepositoryUpdateWorker
).
to
receive
(
:perform_async
)
.
once
.
with
(
project_2
.
id
,
'git@example.com:asd/vim.git'
).
and_return
(
spy
)
subject
.
execute
end
context
'when node has namespace restrictions'
do
it
"does not enqueue IDs of wiki's projects that do not belong to selected namespaces to replicate"
do
create
(
:geo_node
,
:current
,
namespaces:
[
group
])
expect
(
GeoWikiRepositoryUpdateWorker
).
not_to
receive
(
:perform_async
)
.
with
(
project_1
.
id
,
'git@example.com:mike/diaspora.git'
)
expect
(
GeoWikiRepositoryUpdateWorker
).
to
receive
(
:perform_async
)
.
once
.
with
(
project_2
.
id
,
'git@example.com:asd/vim.git'
).
and_return
(
spy
)
subject
.
execute
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