I have a file upload application. I want to test my Upload
controller. For that how do I pass a file to my test? For file upload in my application I use an external application/plugin (Flash/HTML5/HTML4).
Asked
Active
Viewed 278 times
0

y2p
- 4,791
- 10
- 40
- 56
1 Answers
3
Somehow like this:
use Test::Mojo;
my $t = Test::Mojo->new('MyApp');
$t->post_form_ok('/my_action', {my_upload => {file => '/path/to/file'}});

Denis Ibaev
- 2,470
- 23
- 29
-
Thanks, this worked. I was trying something like `$t->param(file => '/path')` – y2p Jun 26 '12 at 14:33