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
602f6bc8
Commit
602f6bc8
authored
Dec 04, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure empty uploads doesn’t break anything
parent
fcbd2fe6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
spec/migrations/track_untracked_uploads_spec.rb
spec/migrations/track_untracked_uploads_spec.rb
+9
-1
No files found.
spec/migrations/track_untracked_uploads_spec.rb
View file @
602f6bc8
...
@@ -5,6 +5,7 @@ describe TrackUntrackedUploads, :migration, :sidekiq do
...
@@ -5,6 +5,7 @@ describe TrackUntrackedUploads, :migration, :sidekiq do
include
TrackUntrackedUploadsHelpers
include
TrackUntrackedUploadsHelpers
let
(
:untracked_files_for_uploads
)
{
table
(
:untracked_files_for_uploads
)
}
let
(
:untracked_files_for_uploads
)
{
table
(
:untracked_files_for_uploads
)
}
let
(
:uploads
)
{
table
(
:uploads
)
}
matcher
:be_scheduled_migration
do
matcher
:be_scheduled_migration
do
match
do
|
migration
|
match
do
|
migration
|
...
@@ -33,7 +34,6 @@ describe TrackUntrackedUploads, :migration, :sidekiq do
...
@@ -33,7 +34,6 @@ describe TrackUntrackedUploads, :migration, :sidekiq do
let!
(
:user2
)
{
create
(
:user
,
:with_avatar
)
}
let!
(
:user2
)
{
create
(
:user
,
:with_avatar
)
}
let!
(
:project1
)
{
create
(
:project
,
:with_avatar
)
}
let!
(
:project1
)
{
create
(
:project
,
:with_avatar
)
}
let!
(
:project2
)
{
create
(
:project
,
:with_avatar
)
}
let!
(
:project2
)
{
create
(
:project
,
:with_avatar
)
}
let
(
:uploads
)
{
table
(
:uploads
)
}
before
do
before
do
UploadService
.
new
(
project1
,
uploaded_file
,
FileUploader
).
execute
# Markdown upload
UploadService
.
new
(
project1
,
uploaded_file
,
FileUploader
).
execute
# Markdown upload
...
@@ -90,4 +90,12 @@ describe TrackUntrackedUploads, :migration, :sidekiq do
...
@@ -90,4 +90,12 @@ describe TrackUntrackedUploads, :migration, :sidekiq do
expect
(
table_exists?
(
:untracked_files_for_uploads
)).
to
be_falsey
expect
(
table_exists?
(
:untracked_files_for_uploads
)).
to
be_falsey
end
end
end
end
context
'without any uploads ever'
do
it
'does not add any upload records'
do
expect
do
migrate!
end
.
not_to
change
{
uploads
.
count
}.
from
(
0
)
end
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