1use strict;
2use warnings;
3
4use Test::More tests => 2;
5
6use HTML::FormFu;
7
8=pod
9
10The input class was getting " text" appended again.
11Fixed by cloning the elements in HTML::FormFu::result()
12
13=cut
14
15my $form = HTML::FormFu->new(
16    { tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );
17
18$form->element('Text')->name('foo');
19$form->element('Text')->name('bar');
20
21my $xhtml = <<EOF;
22<form action="" method="post">
23<div>
24<input name="foo" type="text" />
25</div>
26<div>
27<input name="bar" type="text" />
28</div>
29</form>
30EOF
31
32# 1st result
33{
34    $form->process( {} );
35    is( "$form", $xhtml, 'stringified form' );
36}
37
38# 2nd result
39{
40    $form->process( {} );
41    is( "$form", $xhtml, 'stringified form' );
42}
43