0

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).

y2p
  • 4,791
  • 10
  • 40
  • 56

1 Answers1

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