| 1 |
use strict; |
| 2 |
use warnings; |
| 3 |
use Test::More; |
| 4 |
|
| 5 |
{ |
| 6 |
package MyApp::Form::Test; |
| 7 |
use HTML::FormHandler::Moose; |
| 8 |
extends 'HTML::FormHandler'; |
| 9 |
|
| 10 |
has_field 'foo'; |
| 11 |
|
| 12 |
with 'MyApp::Form::Role::Factors'; |
| 13 |
|
| 14 |
has_field '+bar_one' => ( accessor => 'dimension_value_ids' ); |
| 15 |
has_field '+bar_two' => ( accessor => 'factor_value_ids' ); |
| 16 |
} |
| 17 |
|
| 18 |
|
| 19 |
{ |
| 20 |
package MyApp::Form::Role::Factors; |
| 21 |
|
| 22 |
use HTML::FormHandler::Moose::Role; |
| 23 |
|
| 24 |
has_field bar_one => ( type => 'Repeatable', required => 0 ); |
| 25 |
has_field 'bar_one.contains' => ( type => 'Integer' ); |
| 26 |
has_field bar_two => ( type => 'Repeatable', required => 0 ); |
| 27 |
has_field 'bar_two.contains' => ( type => 'Integer' ); |
| 28 |
} |
| 29 |
|
| 30 |
my $form = MyApp::Form::Test->new; |
| 31 |
ok( $form ); |
| 32 |
|
| 33 |
done_testing; |