« Return to Thread: Attachment-fu + Story Runner
Hi Luis,I read through that thread, but unfortunately it wasn't much help.fixture_file_upload also creates an ActionController::TestUploadedFile. It's is just a shortcut to ActionController::TestUploadedFile.new.There's no problem with the path - it creates the fixture and loads the file, and has the right values inside if I inspect the params directly before posting them:{:filename=>"file-TFile.txt", :uploaded_data=>#<ActionController::TestUploadedFile:0x33f83bc @content_type=#<Mime::Type:0x10e2490 @symbol=:text, @synonyms=[], @string="text/plain">, @tempfile=#<File:/tmp/test_upload29049-0.txt>, @original_filename="test_upload.txt">}It's only once this is passed into the controller that it all gets to_s'ed.I like the idea of 'providing a real file upload', but I'm not sure how to do that in a Story... if anyone has any suggestions or pointers, they would be welcome!Thanks,DanielOn 11 Dec 2007, at 14:39 11 Dec 2007, Luis Lavena wrote:On Dec 11, 2007 10:57 AM, Daniel Tenner <daniel.ruby@...> wrote:I've pasted up the code at:Since there are quite a few files involved.Thanks for your time,A similar discussion was raised back in november (about fixture_file_upload):Instead of mocking the FileUpload, why not provide a real one?After all, the StoryRunner is aimed to fully exercise your code :-DAlso, adjust the path of your TestFileUpload file location, instead ofa relative one (../spec/fixtures) provide one related to RAILS_ROOT,which will work no matter where you put your helper or what is yourcurrent directory (Dir.chdir).HTH,--Luis LavenaMultimedia systems-A common mistake that people make when trying to designsomething completely foolproof is to underestimatethe ingenuity of complete fools.Douglas Adams_______________________________________________rspec-users mailing list_______________________________________________rspec-users mailing list
« Return to Thread: Attachment-fu + Story Runner
| Free embeddable forum powered by Nabble | Forum Help |