Testing File Upload error

I am trying to build some tests where a file is uploaded and than
processed by file column. Perhaps I am misunderstanding the new
fixture_file_upload that was introduced in 1.1 but I can’t seem to
get it to work correctly. I am trying to run a functional test to
make sure that a redirect is made to the appropriate page from a
create action. I create an issue and the issue can have a picture
attached to it, and depending on if the user wants to create another
issue or not is redirected to another form or they are redirected to
a list of all issues.

Here is the basic user flow:

Action called: new
fill out form
action called: create
redirected to either action list, or action new

if I comment out the following line:

‘cover’ => fixture_file_upload(’/files/
18932_20051218002317_large-1.jpg’, ‘image/jpg’),

everything works as it should and the test passes however if I leave
the line in I get an error for the test. However the error is not
consistant, In my action I create two objects based on the single
form (one is a child of the first). I have recieved template not
found for action create errors which is true as create is not a page,
as well as Mysql::Error: Column ‘issue_id’ cannot be null:.

Any thoughts? Am I going about testing a file upload wrong? the form
and actions work perfect in my dev environment where I upload and
fill out the form manually but in test it does not.

Thanks

Andrew

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs