summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-05-10 16:57:53 +0900
committerShinya Maeda <shinya@gitlab.com>2018-05-10 16:57:53 +0900
commitdd32ed7c4b1ad3655eb278a6c319ad3be49b88eb (patch)
tree11354a17662efbdd4e0c2b7f05e9a8a0615832ea
parent3364f57400ac989df780b51e911641b25be9b82e (diff)
downloadgitlab-ce-lfs-uploader-filename-fix.tar.gz
Fix lfs restorer speclfs-uploader-filename-fix
-rw-r--r--lib/carrier_wave_string_file.rb5
-rw-r--r--spec/factories/lfs_objects.rb4
-rw-r--r--spec/lib/gitlab/import_export/lfs_restorer_spec.rb5
3 files changed, 5 insertions, 9 deletions
diff --git a/lib/carrier_wave_string_file.rb b/lib/carrier_wave_string_file.rb
deleted file mode 100644
index 21bfb707fc8..00000000000
--- a/lib/carrier_wave_string_file.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-# class CarrierWaveStringFile < StringIO
-# def original_filename
-# ""
-# end
-# end
diff --git a/spec/factories/lfs_objects.rb b/spec/factories/lfs_objects.rb
index c2b4a50e01d..7821464735f 100644
--- a/spec/factories/lfs_objects.rb
+++ b/spec/factories/lfs_objects.rb
@@ -17,9 +17,7 @@ FactoryBot.define do
UploadedFile.new(tmp_file.path,
filename: file_sha256[4..-1],
- content_type: 'application/octet-stream',
- sha256: file_sha256,
- remote_id: nil)
+ content_type: 'application/octet-stream')
end
oid { Digest::SHA256.file(file.path).hexdigest }
diff --git a/spec/lib/gitlab/import_export/lfs_restorer_spec.rb b/spec/lib/gitlab/import_export/lfs_restorer_spec.rb
index 70eeb9ee66b..dc7d05fc2c8 100644
--- a/spec/lib/gitlab/import_export/lfs_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/lfs_restorer_spec.rb
@@ -26,7 +26,10 @@ describe Gitlab::ImportExport::LfsRestorer do
File.write(dummy_lfs_file.path, content)
size = dummy_lfs_file.size
oid = LfsObject.calculate_oid(dummy_lfs_file.path)
- LfsObject.create!(oid: oid, size: size, file: dummy_lfs_file)
+ LfsObject.create(oid: oid, size: size,
+ file: UploadedFile.new(dummy_lfs_file.path,
+ filename: oid[4..-1],
+ content_type: 'application/octet-stream'))
end
before do