[rspec-users] Attachment-fu + Story Runner
daniel.ruby at tenner.org
Tue Dec 11 09:54:56 EST 2007
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
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:
0x33f83bc @content_type=#<Mime::Type:0x10e2490 @symbol=:text,
@synonyms=, @string="text/plain">, @tempfile=#<File:/tmp/
It's only once this is passed into the controller that it all gets
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!
On 11 Dec 2007, at 14:39 11 Dec 2007, Luis Lavena wrote:
> On Dec 11, 2007 10:57 AM, Daniel Tenner <daniel.ruby at tenner.org>
>> 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
> Instead of mocking the FileUpload, why not provide a real one?
> After all, the StoryRunner is aimed to fully exercise your code :-D
> Also, adjust the path of your TestFileUpload file location, instead of
> a relative one (../spec/fixtures) provide one related to RAILS_ROOT,
> which will work no matter where you put your helper or what is your
> current directory (Dir.chdir).
> Luis Lavena
> Multimedia systems
> A common mistake that people make when trying to design
> something completely foolproof is to underestimate
> the ingenuity of complete fools.
> Douglas Adams
> rspec-users mailing list
> rspec-users at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users