#!/usr/bin/env perl
BEGIN {
plan
skip_all
=>
'this test needs Test::WWW::Mechanize::Catalyst'
unless
eval
"require Test::WWW::Mechanize::Catalyst"
;
plan
tests
=> 15;
}
my
$mech
= Test::WWW::Mechanize::Catalyst->new;
$mech
->content_like(
qr/it works/
i,
'index page'
);
$mech
->content_like(
qr/FORM/
i,
'form page - valid'
);
$mech
->submit_form_ok( {},
'submit form'
);
$mech
->content_like(
qr/CONFIRM/
i,
'submit to confirm page - valid'
);
$mech
->submit_form_ok( {},
'submit form'
);
$mech
->content_like(
qr/SUCCESS/
i,
'submit to success page - valid'
);
$mech
->reload;
$mech
->content_like(
qr/INVALID ACCESS/
i,
'reload on success page - invalid'
);
$mech
->back;
$mech
->content_like(
qr/CONFIRM/
i,
'back to confirm page - valid'
);
$mech
->submit;
$mech
->content_like(
qr/INVALID ACCESS/
i,
'submit to success page - invalid'
);
$mech
->back;
$mech
->back;
$mech
->reload;
$mech
->content_like(
qr/FORM/
i,
'back to form page - valid'
);
$mech
->submit;
$mech
->content_like(
qr/CONFIRM/
i,
'submit to confirm page - valid'
);
$mech
->submit;
$mech
->content_like(
qr/SUCCESS/
i,
'submit to success page - valid'
);
=cut