We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
Thanks so much for Rack::Test; it's an incredibly useful library for me.
I think I might have uncovered a bug. I'd like to be able to specify an array of file uploads as params to a post request:
foo = Rack::Test::UploadedFile.new('foo.txt', 'text/plain') bar = Rack::Test::UploadedFile.new('bar.txt', 'text/plain') post "photos", :photo => { :file => [foo, bar]}
But in the controller, I receive the following params:
{"photo"=>{"file"=>[{"foo"=>"", "bar"=>""}]}, "action"=>"create", "controller"=>"photos"}
When posting a single file, the file is available in the params, as expected:
{"photo"=>{"file"=>#<File:/var/folders/QR/QR1Z8LNdGlaaW1vRT-ls2E+++TI/-Tmp-/RackMultipart20100322-9449-1o9a6i1-0>}, "action"=>"create", "controller"=>"photos"}
I'm happy to try a patch, but thought I'd ask whether I'm doing something stupid first!
Thanks very much.
The text was updated successfully, but these errors were encountered:
I've looked at this some more, and think it's a problem with Rack::Test::Utils#build_multipart.
I've added some specs for this case and they're passing here: http://github.com/louismrose/rack-test/commit/9a0eb89956ae8723bf3d270bab6b0c2f81047ed7
I'll also send a pull request :)
Sorry, something went wrong.
Any news about this? louismrose's diff also fixes a problem with rails' foo_ids[] parameters for me.
Thanks!
Thanks for the patch, Louis. Applied to master.
No branches or pull requests
Hi,
Thanks so much for Rack::Test; it's an incredibly useful library for me.
I think I might have uncovered a bug. I'd like to be able to specify an array of file uploads as params to a post request:
But in the controller, I receive the following params:
When posting a single file, the file is available in the params, as expected:
I'm happy to try a patch, but thought I'd ask whether I'm doing something stupid first!
Thanks very much.
The text was updated successfully, but these errors were encountered: