You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a form that uses the multiple: true option to allow me to upload multiple files at a time. I can upload multiple files just fine, but when I run my tests that do not choose a file to upload, my controller crashes because it tries to find a file named "".
Spec:
it"can create region for zone"dofill_in"x_coords_1",with: 0fill_in"y_coords_1",with: 0fill_in"x_coords_2",with: 10fill_in"y_coords_2",with: 0fill_in"x_coords_3",with: 10fill_in"y_coords_3",with: 10fill_in"x_coords_4",with: 0fill_in"y_coords_4",with: 10click_button"Create Zone"page.shouldhave_content"Zone was successfully created"end
Error: Paperclip::AdapterRegistry::NoHandlerError: No handler found for ""
If I remove the multiple: true declaration from the form, the spec passes just fine.
If I recreate the process myself in a browser, the program works just fine. It's only when running the tests that this field is submitted incorrectly. It appears that instead of submitting the form with zone[shapefiles_attributes][][asset] set to nil, it is submitting the form with a value of "".
The text was updated successfully, but these errors were encountered:
ghost
pushed a commit
that referenced
this issue
Jul 2, 2013
I just added a test case which seems to prove that the form is indeed being submitted with a value of nil, and not "", at least given Sinatra's params parser. Could you please re-check and see if this isn't an issue with your application somewhere?
I asked over on SO: http://stackoverflow.com/questions/17170171/capybara-form-with-multiple-true-getting-sent-the-wrong-value
I have a form that uses the multiple: true option to allow me to upload multiple files at a time. I can upload multiple files just fine, but when I run my tests that do not choose a file to upload, my controller crashes because it tries to find a file named "".
Spec:
Form:
Error:
Paperclip::AdapterRegistry::NoHandlerError: No handler found for ""
If I remove the
multiple: true
declaration from the form, the spec passes just fine.If I recreate the process myself in a browser, the program works just fine. It's only when running the tests that this field is submitted incorrectly. It appears that instead of submitting the form with
zone[shapefiles_attributes][][asset]
set tonil
, it is submitting the form with a value of""
.The text was updated successfully, but these errors were encountered: