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
1720c12e
Commit
1720c12e
authored
Jun 27, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Geo::ProjectRegistry spec
parent
751d0cba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
27 deletions
+3
-27
spec/models/geo/project_registry_spec.rb
spec/models/geo/project_registry_spec.rb
+3
-27
No files found.
spec/models/geo/project_registry_spec.rb
View file @
1720c12e
...
...
@@ -14,43 +14,19 @@ describe Geo::ProjectRegistry, models: true do
let
(
:synced_at
)
{
Time
.
now
}
it
'does not return dirty projects'
do
Geo
::
ProjectRegistry
.
create
(
project:
project
,
last_repository_synced_at:
synced_at
,
last_repository_successful_sync_at:
synced_at
,
last_wiki_synced_at:
synced_at
,
last_wiki_successful_sync_at:
synced_at
,
resync_repository:
true
,
resync_wiki:
true
)
create
(
:geo_project_registry
,
:synced
,
:dirty
,
project:
project
)
expect
(
described_class
.
synced
).
to
be_empty
end
it
'does not return projects where last attempt to sync failed'
do
Geo
::
ProjectRegistry
.
create
(
project:
project
,
last_repository_synced_at:
synced_at
,
last_repository_successful_sync_at:
nil
,
last_wiki_synced_at:
synced_at
,
last_wiki_successful_sync_at:
nil
,
resync_repository:
true
,
resync_wiki:
true
)
create
(
:geo_project_registry
,
:sync_failed
,
project:
project
)
expect
(
described_class
.
synced
).
to
be_empty
end
it
'returns synced projects'
do
registry
=
Geo
::
ProjectRegistry
.
create
(
project:
project
,
last_repository_synced_at:
synced_at
,
last_repository_successful_sync_at:
synced_at
,
last_wiki_synced_at:
synced_at
,
last_wiki_successful_sync_at:
synced_at
,
resync_repository:
false
,
resync_wiki:
false
)
registry
=
create
(
:geo_project_registry
,
:synced
,
project:
project
)
expect
(
described_class
.
synced
).
to
match_array
([
registry
])
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