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
27011f77
Commit
27011f77
authored
Jul 05, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the Geo::ProjectRegistry factory on geo_repository_worker_spec.rb
parent
380a7636
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
36 deletions
+5
-36
spec/workers/geo_repository_sync_worker_spec.rb
spec/workers/geo_repository_sync_worker_spec.rb
+5
-36
No files found.
spec/workers/geo_repository_sync_worker_spec.rb
View file @
27011f77
...
@@ -20,19 +20,8 @@ describe GeoRepositorySyncWorker do
...
@@ -20,19 +20,8 @@ describe GeoRepositorySyncWorker do
end
end
it
'performs Geo::ProjectSyncWorker for projects where last attempt to sync failed'
do
it
'performs Geo::ProjectSyncWorker for projects where last attempt to sync failed'
do
Geo
::
ProjectRegistry
.
create
(
create
(
:geo_project_registry
,
:sync_failed
,
project:
project_1
)
project:
project_1
,
create
(
:geo_project_registry
,
:synced
,
project:
project_2
)
last_repository_synced_at:
DateTime
.
now
,
last_repository_successful_sync_at:
nil
)
Geo
::
ProjectRegistry
.
create
(
project:
project_2
,
last_repository_synced_at:
DateTime
.
now
,
last_repository_successful_sync_at:
DateTime
.
now
,
resync_repository:
false
,
resync_wiki:
false
)
expect
(
Geo
::
ProjectSyncWorker
).
to
receive
(
:perform_in
).
once
.
and_return
(
spy
)
expect
(
Geo
::
ProjectSyncWorker
).
to
receive
(
:perform_in
).
once
.
and_return
(
spy
)
...
@@ -40,29 +29,9 @@ describe GeoRepositorySyncWorker do
...
@@ -40,29 +29,9 @@ describe GeoRepositorySyncWorker do
end
end
it
'performs Geo::ProjectSyncWorker for synced projects updated recently'
do
it
'performs Geo::ProjectSyncWorker for synced projects updated recently'
do
Geo
::
ProjectRegistry
.
create
(
create
(
:geo_project_registry
,
:synced
,
:repository_dirty
,
project:
project_1
)
project:
project_1
,
create
(
:geo_project_registry
,
:synced
,
project:
project_2
)
last_repository_synced_at:
2
.
days
.
ago
,
create
(
:geo_project_registry
,
:synced
,
:wiki_dirty
)
last_repository_successful_sync_at:
2
.
days
.
ago
,
resync_repository:
true
,
resync_wiki:
false
)
Geo
::
ProjectRegistry
.
create
(
project:
project_2
,
last_repository_synced_at:
10
.
minutes
.
ago
,
last_repository_successful_sync_at:
10
.
minutes
.
ago
,
resync_repository:
false
,
resync_wiki:
false
)
Geo
::
ProjectRegistry
.
create
(
project:
create
(
:empty_project
),
last_repository_synced_at:
5
.
minutes
.
ago
,
last_repository_successful_sync_at:
5
.
minutes
.
ago
,
resync_repository:
false
,
resync_wiki:
true
)
expect
(
Geo
::
ProjectSyncWorker
).
to
receive
(
:perform_in
).
twice
.
and_return
(
spy
)
expect
(
Geo
::
ProjectSyncWorker
).
to
receive
(
:perform_in
).
twice
.
and_return
(
spy
)
...
...
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