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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
77be7efc
Commit
77be7efc
authored
Dec 05, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Guarantee all IDs are included
parent
602f6bc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb
...b/background_migration/populate_untracked_uploads_spec.rb
+5
-5
No files found.
spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb
View file @
77be7efc
...
...
@@ -46,7 +46,7 @@ describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, :sid
it
'adds untracked files to the uploads table'
do
expect
do
subject
.
perform
(
1
,
1000
)
subject
.
perform
(
1
,
untracked_files_for_uploads
.
last
.
id
)
end
.
to
change
{
uploads
.
count
}.
from
(
4
).
to
(
8
)
expect
(
user2
.
uploads
.
count
).
to
eq
(
1
)
...
...
@@ -58,12 +58,12 @@ describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, :sid
expect
(
subject
).
to
receive
(
:drop_temp_table_if_finished
)
# Don't drop the table so we can look at it
expect
do
subject
.
perform
(
1
,
1000
)
subject
.
perform
(
1
,
untracked_files_for_uploads
.
last
.
id
)
end
.
to
change
{
untracked_files_for_uploads
.
count
}.
from
(
8
).
to
(
0
)
end
it
'does not create duplicate uploads of already tracked files'
do
subject
.
perform
(
1
,
1000
)
subject
.
perform
(
1
,
untracked_files_for_uploads
.
last
.
id
)
expect
(
user1
.
uploads
.
count
).
to
eq
(
1
)
expect
(
project1
.
uploads
.
count
).
to
eq
(
2
)
...
...
@@ -140,7 +140,7 @@ describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, :sid
it
'creates an Upload record'
do
expect
do
subject
.
perform
(
1
,
1000
)
subject
.
perform
(
1
,
untracked_files_for_uploads
.
last
.
id
)
end
.
to
change
{
model
.
reload
.
uploads
.
count
}.
from
(
0
).
to
(
1
)
expect
(
model
.
uploads
.
first
.
attributes
).
to
include
(
expected_upload_attrs
)
...
...
@@ -206,7 +206,7 @@ describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, :sid
it
'creates an Upload record'
do
expect
do
subject
.
perform
(
1
,
1000
)
subject
.
perform
(
1
,
untracked_files_for_uploads
.
last
.
id
)
end
.
to
change
{
model
.
reload
.
uploads
.
count
}.
from
(
0
).
to
(
1
)
expect
(
model
.
uploads
.
first
.
attributes
).
to
include
(
@expected_upload_attrs
)
...
...
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