use Mojo::Base -strict; use lib 'lib'; use local::lib 'local'; use Test::More; use Test::Mojo; my $t = Test::Mojo->new('Shrlbe'); $t->get_ok('/')->status_is(200)->content_like(qr/URL Shortener/i); $t->get_ok('/s/ya.ru')->status_is(200)->content_like(qr/shrl.be\/1c570448/i); $t->post_ok('/' => form => {url => 'ya.ru'})->status_is(200)->content_like(qr/shrl.be\/1c570448/i); $t->get_ok('/1c570448')->status_is(307); $t->get_ok('/unknown_hash')->status_is(404); done_testing();