Topic: Need help with file upload testing

Hi,

I'm trying to functional test the uploading of user avatar images. My post statement from the test is below, and it includes the :avatar file along with the :multipart parameter and two session paramaters. Whenever I execute this test, the file is truncated to 1k and the test fails. Am I using the :multipart parameter correctly? Is there something else I'm missing?

post :update, {:avatar => {:photo => fixture_file_upload('/files/saturn.jpg', 'image/jpeg')}, :multipart => true}, {'current_user_id' => @current_user.id, 'current_space_id' => spaces(:space_1).id}

Any help would be greatly appreciated.

Thanks,
Jason

Re: Need help with file upload testing

Did you ever figure this out? I'm working on testing file uploads as well, and looking for the proper syntax.

Re: Need help with file upload testing

I left out the multipart parameter and it worked OK for my test.