end
end
- test 'create collection with large manifest text and verify file_names' do
- act_as_system_user do
- manifest_text = ". d41d8cd98f00b204e9800998ecf8427e+0"
- index = 0
- while manifest_text.length < 2**15
- manifest_text += ' ' + "0:0:foo#{index}.txt"
- index += 1
- end
- manifest_text += "\n"
+ [
+ 2**8,
+ 2**18,
+ ].each do |manifest_size|
+ test "create collection with manifest size #{manifest_size} and
+ not expect exceptions even on very large manifest texts" do
+ # file_names has a max size, hence there will be no errors even on large manifests
+ act_as_system_user do
+ manifest_text = '. d41d8cd98f00b204e9800998ecf8427e+0'
+ index = 0
+ while manifest_text.length < manifest_size
+ manifest_text += ' ' + "0:0:veryverylongfilename000000000000#{index}.txt"
+ index += 1
+ end
+ manifest_text += "\n"
- c = Collection.create(manifest_text: manifest_text)
+ c = Collection.create(manifest_text: manifest_text)
- assert c.valid?
- created_file_names = c.file_names
- assert created_file_names
+ assert c.valid?
+ created_file_names = c.file_names
+ assert created_file_names
+ end
end
end
-
end