porting changes from upstream
This commit is contained in:
parent
c614089d65
commit
a5bb17ffd5
|
@ -35,12 +35,12 @@ class GitlabUploader < CarrierWave::Uploader::Base
|
|||
|
||||
# Reduce disk IO
|
||||
def move_to_cache
|
||||
super.nil? ? true : super
|
||||
file_storage?
|
||||
end
|
||||
|
||||
# Reduce disk IO
|
||||
def move_to_store
|
||||
super.nil? ? true : super
|
||||
file_storage?
|
||||
end
|
||||
|
||||
def exists?
|
||||
|
|
|
@ -18,7 +18,7 @@ FactoryBot.define do
|
|||
end
|
||||
|
||||
trait :with_avatar do
|
||||
avatar { File.open(Rails.root.join('spec/fixtures/dk.png')) }
|
||||
avatar { fixture_file_upload('spec/fixtures/dk.png') }
|
||||
end
|
||||
|
||||
trait :access_requestable do
|
||||
|
|
|
@ -90,7 +90,7 @@ FactoryBot.define do
|
|||
end
|
||||
|
||||
trait :with_avatar do
|
||||
avatar { File.open(Rails.root.join('spec/fixtures/dk.png')) }
|
||||
avatar { fixture_file_upload('spec/fixtures/dk.png') }
|
||||
end
|
||||
|
||||
trait :broken_storage do
|
||||
|
|
|
@ -38,7 +38,7 @@ FactoryBot.define do
|
|||
end
|
||||
|
||||
trait :with_avatar do
|
||||
avatar { File.open(Rails.root.join('spec/fixtures/dk.png')) }
|
||||
avatar { fixture_file_upload('spec/fixtures/dk.png') }
|
||||
end
|
||||
|
||||
trait :two_factor_via_otp do
|
||||
|
|
|
@ -11,16 +11,4 @@ describe AttachmentUploader do
|
|||
store_dir: %r[uploads/-/system/note/attachment/],
|
||||
upload_path: %r[uploads/-/system/note/attachment/],
|
||||
absolute_path: %r[#{CarrierWave.root}/uploads/-/system/note/attachment/]
|
||||
|
||||
describe '#move_to_cache' do
|
||||
it 'is true' do
|
||||
expect(uploader.move_to_cache).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#move_to_store' do
|
||||
it 'is true' do
|
||||
expect(uploader.move_to_store).to eq(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue