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
a67d92d1
Commit
a67d92d1
authored
May 07, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
fa1f244c
ef2c1a6b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
4 deletions
+37
-4
app/uploaders/import_export_uploader.rb
app/uploaders/import_export_uploader.rb
+0
-4
changelogs/unreleased/sh-cleanup-import-export.yml
changelogs/unreleased/sh-cleanup-import-export.yml
+5
-0
spec/uploaders/import_export_uploader_spec.rb
spec/uploaders/import_export_uploader_spec.rb
+32
-0
No files found.
app/uploaders/import_export_uploader.rb
View file @
a67d92d1
...
...
@@ -7,10 +7,6 @@ class ImportExportUploader < AttachmentUploader
EXTENSION_WHITELIST
end
def
move_to_store
true
end
def
move_to_cache
false
end
...
...
changelogs/unreleased/sh-cleanup-import-export.yml
0 → 100644
View file @
a67d92d1
---
title
:
Clean up CarrierWave's import/export files
merge_request
:
27487
author
:
type
:
fixed
spec/uploaders/import_export_uploader_spec.rb
View file @
a67d92d1
...
...
@@ -3,9 +3,18 @@ require 'spec_helper'
describe
ImportExportUploader
do
let
(
:model
)
{
build_stubbed
(
:import_export_upload
)
}
let
(
:upload
)
{
create
(
:upload
,
model:
model
)
}
let
(
:import_export_upload
)
{
ImportExportUpload
.
new
}
subject
{
described_class
.
new
(
model
,
:import_file
)
}
context
'local store'
do
describe
'#move_to_store'
do
it
'returns true'
do
expect
(
subject
.
move_to_store
).
to
be
true
end
end
end
context
"object_store is REMOTE"
do
before
do
stub_uploads_object_storage
...
...
@@ -16,5 +25,28 @@ describe ImportExportUploader do
it_behaves_like
'builds correct paths'
,
store_dir:
%r[import_export_upload/import_file/]
,
upload_path:
%r[import_export_upload/import_file/]
describe
'#move_to_store'
do
it
'returns false'
do
expect
(
subject
.
move_to_store
).
to
be
false
end
end
describe
'with an export file directly uploaded'
do
let
(
:tempfile
)
{
Tempfile
.
new
([
'test'
,
'.gz'
])
}
before
do
stub_uploads_object_storage
(
described_class
,
direct_upload:
true
)
import_export_upload
.
export_file
=
tempfile
end
it
'cleans up cached file'
do
cache_dir
=
File
.
join
(
import_export_upload
.
export_file
.
cache_path
(
nil
),
'*'
)
import_export_upload
.
save!
expect
(
Dir
[
cache_dir
]).
to
be_empty
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