if
($@) {
plan
skip_all
=>
'HTML::FormFu::MultiForm required for MultiForm tests'
;
die
$@;
}
plan
tests
=> 13;
my
$mech
= Test::WWW::Mechanize::Catalyst->new;
my
(
$form
) =
$mech
->forms;
ok(
$form
);
is(
$form
->attr(
'id'
),
'formmethod'
);
ok(
$form
->find_input(
'page1'
) );
my
$uri
=
$form
->action;
$mech
->post_ok(
$uri
, {
page1
=>
'foo'
} );
undef
$form
;
(
$form
) =
$mech
->forms;
ok(
$form
);
undef
$uri
;
$uri
=
$form
->action;
is(
$form
->attr(
'id'
),
'formmethod'
);
ok(
$form
->find_input(
'page2'
) );
ok(
$form
->find_input(
'_multiform'
) );
my
$hidden_value
=
$form
->value(
'_multiform'
);
$mech
->post_ok(
$uri
,
{
_multiform
=>
$hidden_value
,
page2
=>
'bar'
,
}
);
$mech
->content_contains(
'Complete'
);
$mech
->content_contains(
'page1: foo'
);
$mech
->content_contains(
'page2: bar'
);