App-BlurFill

 view release on metacpan or  search on metacpan

t/02-web.t  view on Meta::CPAN

        like($res->content, qr/<form[^>]+action="\/blur"/i, 'Response contains form with action="/blur"');
        like($res->content, qr/<form[^>]+method="POST"/i, 'Response contains form with method="POST"');
        like($res->content, qr/<form[^>]+enctype="multipart\/form-data"/i, 'Response contains form with multipart encoding');
        like($res->content, qr/<input[^>]+type="file"[^>]+name="image"/i, 'Response contains file input for image');
        like($res->content, qr/<input[^>]+type="number"[^>]+name="width"/i, 'Response contains number input for width');
        like($res->content, qr/<input[^>]+type="number"[^>]+name="height"/i, 'Response contains number input for height');
    };

# Test POST /blur route - should return an HTML results page
open my $fh, '<', $image or die "Can't read image: $!";
binmode $fh;
my $content = do { local $/; <$fh> };

my $req = POST '/blur',
    Content_Type => 'form-data',
    Content => [
        image => [ undef, basename($image), Content => $content, 'Content-Type' => 'image/jpeg' ],
        width => 800,
        height => 450,
    ];



( run in 0.760 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )