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
7c6680b8
Commit
7c6680b8
authored
Dec 01, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add different types of uploads on Geo::AttachmentRegistryFinder spec
parent
e4a8602d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
spec/ee/spec/finders/geo/attachment_registry_finder_spec.rb
spec/ee/spec/finders/geo/attachment_registry_finder_spec.rb
+18
-9
No files found.
spec/ee/spec/finders/geo/attachment_registry_finder_spec.rb
View file @
7c6680b8
...
...
@@ -14,9 +14,10 @@ describe Geo::AttachmentRegistryFinder, :geo, :truncate do
let
(
:upload_1
)
{
create
(
:upload
,
model:
synced_group
)
}
let
(
:upload_2
)
{
create
(
:upload
,
model:
unsynced_group
)
}
let
(
:upload_3
)
{
create
(
:upload
,
model:
synced_project
)
}
let
(
:upload_3
)
{
create
(
:upload
,
:issuable_upload
,
model:
synced_project
)
}
let
(
:upload_4
)
{
create
(
:upload
,
model:
unsynced_project
)
}
let
(
:upload_5
)
{
create
(
:upload
,
model:
synced_project
)
}
let
(
:upload_6
)
{
create
(
:upload
,
:personal_snippet
,
model:
synced_project
)
}
subject
{
described_class
.
new
(
current_node:
secondary
)
}
...
...
@@ -40,10 +41,11 @@ describe Geo::AttachmentRegistryFinder, :geo, :truncate do
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_1
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_2
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_3
.
id
,
success:
false
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_6
.
id
)
synced_attachments
=
subject
.
find_synced_attachments
expect
(
synced_attachments
.
pluck
(
:id
)).
to
match_array
([
upload_1
.
id
,
upload_2
.
id
])
expect
(
synced_attachments
.
pluck
(
:id
)).
to
match_array
([
upload_1
.
id
,
upload_2
.
id
,
upload_6
.
id
])
end
context
'with selective sync'
do
...
...
@@ -53,12 +55,13 @@ describe Geo::AttachmentRegistryFinder, :geo, :truncate do
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_3
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_4
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_5
.
id
,
success:
false
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_6
.
id
)
secondary
.
update_attribute
(
:namespaces
,
[
synced_group
])
synced_attachments
=
subject
.
find_synced_attachments
expect
(
synced_attachments
.
pluck
(
:id
)).
to
match_array
([
upload_1
.
id
,
upload_3
.
id
])
expect
(
synced_attachments
.
pluck
(
:id
)).
to
match_array
([
upload_1
.
id
,
upload_3
.
id
,
upload_6
.
id
])
end
end
end
...
...
@@ -74,10 +77,11 @@ describe Geo::AttachmentRegistryFinder, :geo, :truncate do
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_1
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_2
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_3
.
id
,
success:
false
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_6
.
id
,
success:
false
)
failed_attachments
=
subject
.
find_failed_attachments
expect
(
failed_attachments
.
pluck
(
:id
)).
to
match_array
([
upload_3
.
id
])
expect
(
failed_attachments
.
pluck
(
:id
)).
to
match_array
([
upload_3
.
id
,
upload_6
.
id
])
end
context
'with selective sync'
do
...
...
@@ -87,12 +91,13 @@ describe Geo::AttachmentRegistryFinder, :geo, :truncate do
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_3
.
id
,
success:
false
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_4
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_5
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_6
.
id
,
success:
false
)
secondary
.
update_attribute
(
:namespaces
,
[
synced_group
])
failed_attachments
=
subject
.
find_failed_attachments
expect
(
failed_attachments
.
pluck
(
:id
)).
to
match_array
([
upload_1
.
id
,
upload_3
.
id
])
expect
(
failed_attachments
.
pluck
(
:id
)).
to
match_array
([
upload_1
.
id
,
upload_3
.
id
,
upload_6
.
id
])
end
end
end
...
...
@@ -114,10 +119,11 @@ describe Geo::AttachmentRegistryFinder, :geo, :truncate do
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_1
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_2
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_3
.
id
,
success:
false
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_6
.
id
)
synced_attachments
=
subject
.
find_synced_attachments
expect
(
synced_attachments
).
to
match_array
([
upload_1
,
upload_2
])
expect
(
synced_attachments
).
to
match_array
([
upload_1
,
upload_2
,
upload_6
])
end
context
'with selective sync'
do
...
...
@@ -127,12 +133,13 @@ describe Geo::AttachmentRegistryFinder, :geo, :truncate do
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_3
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_4
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_5
.
id
,
success:
false
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_6
.
id
)
secondary
.
update_attribute
(
:namespaces
,
[
synced_group
])
synced_attachments
=
subject
.
find_synced_attachments
expect
(
synced_attachments
).
to
match_array
([
upload_1
,
upload_3
])
expect
(
synced_attachments
).
to
match_array
([
upload_1
,
upload_3
,
upload_6
])
end
end
end
...
...
@@ -148,10 +155,11 @@ describe Geo::AttachmentRegistryFinder, :geo, :truncate do
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_1
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_2
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_3
.
id
,
success:
false
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_6
.
id
,
success:
false
)
failed_attachments
=
subject
.
find_failed_attachments
expect
(
failed_attachments
).
to
match_array
([
upload_3
])
expect
(
failed_attachments
).
to
match_array
([
upload_3
,
upload_6
])
end
context
'with selective sync'
do
...
...
@@ -161,12 +169,13 @@ describe Geo::AttachmentRegistryFinder, :geo, :truncate do
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_3
.
id
,
success:
false
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_4
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_5
.
id
)
create
(
:geo_file_registry
,
:avatar
,
file_id:
upload_6
.
id
,
success:
false
)
secondary
.
update_attribute
(
:namespaces
,
[
synced_group
])
failed_attachments
=
subject
.
find_failed_attachments
expect
(
failed_attachments
).
to
match_array
([
upload_1
,
upload_3
])
expect
(
failed_attachments
).
to
match_array
([
upload_1
,
upload_3
,
upload_6
])
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