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
b9ff27e2
Commit
b9ff27e2
authored
Jun 07, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
d4cd721b
2320e445
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
9 deletions
+25
-9
spec/lib/gitlab/background_migration/migrate_legacy_uploads_spec.rb
...itlab/background_migration/migrate_legacy_uploads_spec.rb
+25
-9
No files found.
spec/lib/gitlab/background_migration/migrate_legacy_uploads_spec.rb
View file @
b9ff27e2
...
...
@@ -5,23 +5,39 @@ describe Gitlab::BackgroundMigration::MigrateLegacyUploads, :migration, schema:
let
(
:test_dir
)
{
FileUploader
.
options
[
'storage_path'
]
}
# rubocop: disable RSpec/FactoriesInMigrationSpecs
let
!
(
:namespace
)
{
create
(
:namespace
)
}
let
!
(
:project
)
{
create
(
:project
,
:legacy_storage
,
namespace:
namespace
)
}
let
!
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:namespace
)
{
create
(
:namespace
)
}
let
(
:project
)
{
create
(
:project
,
:legacy_storage
,
namespace:
namespace
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
!
(
:note1
)
{
create
(
:note
,
note:
'some note text awesome'
,
project:
project
,
noteable:
issue
)
}
let
!
(
:note2
)
{
create
(
:note
,
note:
'some note'
,
project:
project
,
noteable:
issue
)
}
let
(
:note1
)
{
create
(
:note
,
note:
'some note text awesome'
,
project:
project
,
noteable:
issue
)
}
let
(
:note2
)
{
create
(
:note
,
note:
'some note'
,
project:
project
,
noteable:
issue
)
}
let
!
(
:hashed_project
)
{
create
(
:project
,
namespace:
namespace
)
}
let
!
(
:issue_hashed_project
)
{
create
(
:issue
,
project:
hashed_project
)
}
let
!
(
:note_hashed_project
)
{
create
(
:note
,
note:
'some note'
,
project:
hashed_project
,
attachment:
'text.pdf'
,
noteable:
issue_hashed_project
)
}
let
(
:hashed_project
)
{
create
(
:project
,
namespace:
namespace
)
}
let
(
:issue_hashed_project
)
{
create
(
:issue
,
project:
hashed_project
)
}
let
(
:note_hashed_project
)
{
create
(
:note
,
note:
'some note'
,
project:
hashed_project
,
attachment:
'text.pdf'
,
noteable:
issue_hashed_project
)
}
let
!
(
:standard_upload
)
do
let
(
:standard_upload
)
do
create
(
:upload
,
path:
"secretabcde/image.png"
,
model_id:
create
(
:project
).
id
,
model_type:
'Project'
,
uploader:
'FileUploader'
)
end
before
do
# This migration was created before we introduced ProjectCiCdSetting#default_git_depth
allow_any_instance_of
(
ProjectCiCdSetting
).
to
receive
(
:default_git_depth
).
and_return
(
nil
)
allow_any_instance_of
(
ProjectCiCdSetting
).
to
receive
(
:default_git_depth
=
).
and_return
(
0
)
namespace
project
issue
note1
note2
hashed_project
issue_hashed_project
note_hashed_project
standard_upload
end
def
create_remote_upload
(
model
,
filename
)
create
(
:upload
,
:attachment_upload
,
path:
"note/attachment/
#{
model
.
id
}
/
#{
filename
}
"
,
secret:
nil
,
...
...
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