File: plus_field.t

package info (click to toggle)
libhtml-formhandler-perl 0.40057-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,320 kB
  • ctags: 685
  • sloc: perl: 8,849; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 741 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use strict;
use warnings;
use Test::More;

{
    package MyApp::Form::Test;
    use HTML::FormHandler::Moose;
    extends 'HTML::FormHandler';

    has_field 'foo';

    with 'MyApp::Form::Role::Factors';

    has_field '+bar_one' => ( accessor => 'dimension_value_ids' );
    has_field '+bar_two' => ( accessor => 'factor_value_ids' );
}


{
    package MyApp::Form::Role::Factors;

    use HTML::FormHandler::Moose::Role;

    has_field bar_one => ( type => 'Repeatable', required => 0 );
    has_field 'bar_one.contains' => ( type => 'Integer' );
    has_field bar_two => ( type => 'Repeatable', required => 0 );
    has_field 'bar_two.contains' => ( type => 'Integer' );
}

my $form = MyApp::Form::Test->new;
ok( $form );

done_testing;