mePlugin2::register (security violation)
$t->get_ok('/plugin-test-some_plugin2/register')->status_isnt(500)
->status_is(404)->header_is(Server => 'Mojolicious (Perl)')
->content_unlike(qr/Somethin
log->on(message => sub { $log .= pop });
$t->get_ok('/plugin-test-some_plugin2/register')->status_isnt(500)
->status_is(404)->header_is(Server => 'Mojolicious (Perl)')
->content_unlike(qr/Somethin
>get_ok($url => {'X-Test' => 'Hi there!'})->status_isnt(404)
->status_is(200)->status_is(200, 'with description')->status_isnt(500)
->status_isnt(500, 'with description')->header_is('X-Bender' =>
ge_ok->message_is({binary => 'bytes!'})
->send_ok({binary => 'bytes!'})
->message_ok->message_isnt({text => 'bytes!'})->finish_ok;
# Bytes in multiple frames
$t->websocket_ok('/echo')->send_ok([0
)->message_is('[1,2,3,4]')
->message_is('[1,2,3,4]', 'with description')->message_isnt('[1,2,3]')
->message_isnt('[1,2,3]', 'with description')->message_like(qr/3/)
->message_like(qr/3/, 'with d
nish_ok;
$t->websocket_ok('/push')->message_ok->message_unlike(qr/shift/)
->message_ok->message_isnt('shift')->message_ok->message_like(qr/us/)
->message_ok->message_unlike({binary => qr/push/})->
=> 'works';
my $t = Test::Mojo->new;
# Normal route
$t->get_ok('/')->status_is(200)
->header_isnt('Cache-Control' => 'max-age=3600, must-revalidate')
->content_is('works');
# Normal static fil
>header_isnt('Cache-Control' => 'max-age=3600, must-revalidate')
->content_is('Custom response!');
# Conditional response
$t->get_ok('/res.txt?route=1&res=1')->status_is(201)
->header_isnt('Cache
al response!');
# Another custom dispatcher
$t->get_ok('/custom_too')->status_is(200)
->header_isnt('Cache-Control' => 'max-age=3600, must-revalidate')
->content_is('this works too');
# First wr
ory
$t->get_ok('/source')->status_is(200)
->content_type_is('text/plain;charset=UTF-8')->header_isnt('X-Missing' => 1)
->content_like(qr!get_ok\('/source!);
# File does not exist
$log = '';
$cb =
ocation => undef)
->element_exists('#☃')->element_exists_not('#foo')
->text_isnt('#foo' => 'whatever')->text_isnt('div#☃' => 'Redirect')
->text_is('div#☃' => 'Redirect works!')->text_unlik
mePlugin2::register (security violation)
$t->get_ok('/plugin-test-some_plugin2/register')->status_isnt(500)
->status_is(404)->header_is(Server => 'Mojolicious (Perl)')
->content_like(qr/Page not f
in2::register (security violation again)
$t->get_ok('/plugin-test-some_plugin2/register')->status_isnt(500)
->status_is(404)->header_is(Server => 'Mojolicious (Perl)')
->content_like(qr/Page not f
f Mojolicious::Commands->new->run, 'CODE', 'right reference';
local $ENV{MOJO_NO_DETECT} = 1;
isnt ref Mojolicious::Commands->new->run, 'CODE', 'not a CODE reference';
}
# Run command
is ref Mojo