I could test upload of one file
attach_file 'photo', File.join(Rails.root, 'public', 'uploads', 'test.png')
But what if I have a file field with multiple
atribute? How can I test multiple files upload using Cucumber/Capybara?
HTML:
<input id="fileupload" class="photo-uploader" type="file" multiple="" name="images">
Capybara:
page.attach_file "images", ['path to file1.jpg', 'path to file2.jpg', 'path to file3.jpg']
name
attribute of the <input>
with type="file"
and add it as the first parameter.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With