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
cdeab4be
Commit
cdeab4be
authored
Aug 23, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve specs for Geo::ProjectRegistry failed and synced scopes
parent
91616f6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
30 deletions
+6
-30
spec/models/geo/project_registry_spec.rb
spec/models/geo/project_registry_spec.rb
+6
-30
No files found.
spec/models/geo/project_registry_spec.rb
View file @
cdeab4be
...
...
@@ -10,22 +10,10 @@ describe Geo::ProjectRegistry do
end
describe
'.failed'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:synced_at
)
{
Time
.
now
}
it
'does not return synced projects'
do
it
'returns projects where last attempt to sync failed'
do
project
=
create
(
:project
)
create
(
:geo_project_registry
,
:synced
,
project:
project
)
expect
(
described_class
.
failed
).
to
be_empty
end
it
'does not return dirty projects'
do
create
(
:geo_project_registry
,
:synced
,
:dirty
,
project:
project
)
expect
(
described_class
.
synced
).
to
be_empty
end
it
'returns projects where last attempt to sync failed'
do
repository_sync_failed
=
create
(
:geo_project_registry
,
:repository_sync_failed
,
project:
project
)
wiki_sync_failed
=
create
(
:geo_project_registry
,
:wiki_sync_failed
,
project:
project
)
...
...
@@ -34,25 +22,13 @@ describe Geo::ProjectRegistry do
end
describe
'.synced'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:synced_at
)
{
Time
.
now
}
it
'does not return dirty projects'
do
it
'returns synced projects'
do
project
=
create
(
:project
)
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
create
(
:geo_project_registry
,
:sync_failed
,
project:
project
)
synced_project
=
create
(
:geo_project_registry
,
:synced
,
project:
project
)
expect
(
described_class
.
synced
).
to
be_empty
end
it
'returns synced projects'
do
registry
=
create
(
:geo_project_registry
,
:synced
,
project:
project
)
expect
(
described_class
.
synced
).
to
match_array
([
registry
])
expect
(
described_class
.
synced
).
to
match_array
([
synced_project
])
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