fix(export): don't fail when trying to write a file name > 255 bytes
This commit is contained in:
parent
53b7a37fb4
commit
f615facbba
2 changed files with 23 additions and 1 deletions
|
@ -40,5 +40,16 @@ describe DownloadManager::ParallelDownloadQueue do
|
|||
# expect(downloadable_manager.errors).to have_key(destination)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with a destination filename too long' do
|
||||
let(:destination) { 'a' * 252 + '.txt' }
|
||||
|
||||
it 'limit the file path to 255 bytes' do
|
||||
target = File.join(download_to_dir, 'a' * 251 + '.txt')
|
||||
expect { subject }.to change { File.exist?(target) }
|
||||
attachment.file.rewind
|
||||
expect(attachment.file.read).to eq(File.read(target))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue